Simplify component accessibility.
One Facade to rule them all
JRebirth uses a global facade automatically created by JRebirth AbstractApplication class.
The global facade create automatically the JRebirth notification engine. You should read the Notifier page to have more informations.
The global facade also allow to communicate with the Application class and therefore with its stage and scene.
It allows to manage the three main facades:
The GlobaleFacadeBase allow to get each of these facades by calling appropriate getters:
50 55 60 | LocalFacade<Model> getUiFacade(); LocalFacade<Service> getServiceFacade(); LocalFacade<Command> getCommandFacade(); |
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.
34 | GlobalFacade getGlobalFacade(); |
There are 3 LocalFacade, each one is responsible of its layer components.
Each Facade can manage its components (also called readyObject) throught some public methods.
41 51 60 70 82 95 106 118 130 | < 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> UniqueKey< E > buildKey(final Class< E > clazz, final Object... keyPart); |