Fork me on GitHub

Facades Layer

Simplify component accessibility.

How Facades work ?

One Facade to rule the other

The global facade is automatically created by JRebirth AbstractApplication class.

It allows to manage the three main facades :

  • CommandFacade
  • ServiceFacade
  • UiFacade

Short UML Diagram:

The global facade is accessible by the 3 main facades by calling : getGlobalFacade() (each facade extends the AbstractGlobalReady class.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
 * Get more info at : www.jrebirth.org .
 * Copyright JRebirth.org ¬© 2011-2013
 * Contact : sebastien.bordes@jrebirth.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jrebirth.core.facade;
 
/**
 * The class <strong>AbstractGlobalReady</strong>.
 *
 * The base class that wrap access to the global facade.
 *
 * @author S√©bastien Bordes
 */
public abstract class AbstractGlobalReady implements GlobalReady {
 
    /** The main global facade. */
    private final GlobalFacade globalFacade;
 
    /**
     * Default Constructor.
     *
     * @param globalFacade the unique global facade of the application
     */
    public AbstractGlobalReady(final GlobalFacade globalFacade) {
        super();
        this.globalFacade = globalFacade;
    }
 
    /**
     * {@inheritDoc}
     */
    @Override
    public final GlobalFacade getGlobalFacade() {
        return this.globalFacade;
    }
}

Internal Communication

The global facade create automatically the JRebirth notification engine. You should read the Notifier page to have more informations.

Linked with Application

The global facade also allow to communicate with the Application class and therefore with its stage and scene.

Provide Tracking

JRebirth allows to track all creation & finalization of each component (Command, Service, Model, View) and also track the emission of waves and their path.

They are logged in order to be processed by the JRebirthAnalyzer tool.