Fork me on GitHub

Facades Layer

Simplify component accessibility.


JRebirth provide 3+1 Facades used to manage its dedicated pattern wCS-Mvc.


Short UML Diagram:

Global Facade

One Facade to rule them all

JRebirth uses a global facade automatically created by JRebirth AbstractApplication class.

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.

Manage Local Facades

It allows to manage the three main facades:

  • CommandFacade
  • ServiceFacade
  • UiFacade

The GlobaleFacadeBase allow to get each of these facades by calling appropriate getters:

LocalFacade<Model> getUiFacade();
LocalFacade<Service> getServiceFacade();
LocalFacade<Command> getCommandFacade();
LocalFacade<Behavior<?>> getBehaviorFacade();

This link is bidirectionnal because global facade is accessible from the 3 main facades by calling : getGlobalFacade() (each facade extends the AbstractGlobalReady abstract class which implement GlobalReady interface.

GlobalFacade getGlobalFacade();

Local Facades

There are 3 LocalFacade, each one is responsible of its layer components.

Basic Features

Each Facade can manage its components (also called readyObject) throught some public methods.

  • retrieve : used to get a component (build and register it if needed)
  • exists : check if the component is already registered, it could be released
  • register : store a pre-built component
  • unregister : remove a component
  • buildKey : build a unique key for the given component
<E extends R> void register(final UniqueKey<E> uniqueKey, final E readyObject);
<E extends R> void register(final E readyObject, final Object... keyPart);
<E extends R> void unregister(final UniqueKey<E> uniqueKey);
<E extends R> void unregister(final E readyObject, final Object... keyPart);
<E extends R> E retrieve(final UniqueKey<E> uniqueKey);
<E extends R> E retrieve(final Class<E> clazz, final Object... keyPart);
<E extends R> boolean exists(final UniqueKey<E> uniqueKey);
<E extends R> boolean exists(final Class<E> clazz, final Object... keyPart);
<E extends R> List<E> retrieveAll(UniqueKey<E> uniqueKey);
// <E extends R> UniqueKey<E> buildKey(final Class<E> clazz, final Object... keyPart);

Component Key

Define how to manage component Key

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.