Information Technology Reference
In-Depth Information
Integrating components
As we mentioned before, UberFire is heavily dependent on GWT and Errai, integrated in-
ternally through a series of CDI injected events that each component either fires or captures
to decide actions that need to be taken.
Context and Dependency Injection ( CDI ) is a standard defined by Java Enterprise Edi-
tion 6 to compose different components based on their types, names, and specific central-
ized configurations. The idea behind it is remove the need of writing legacy code to initial-
ize and bind together different implementations of components, but allow them to be man-
aged through specific annotations in classes and by configuration files.
Google Web Toolkit ( GWT ) is a framework created by Google that is used to define smart
user interfaces using Java code, which are later (during project compilation) translated into
JavaScript in order to run in a web browser without the need of having any plugins in-
stalled. Its goal is to enable productive development of high-performance web applications
without the developer having to be an expert in browser quirks, Ajax requests, and
JavaScript.
The main problem that a GWT translation of Java to JavaScript has is that it doesn't trans-
late everything. There is a point where you have to split which classes run in the client as
JavaScript and which classes run in the server as Java. Connectivity between the server and
client don't take advantage of other frameworks such as CDI to inject communication stubs.
That's where Errai comes in. Errai provides several GWT extensions for UI templating,
binding, and server communication through simple events. Errai allows users to define CDI
annotations on GWT code and provides a way to translate those annotations and use them
even if the actual component implementations are only server-side (that means, they wer-
en't translated to JavaScript).
This allows components to directly communicate using events irrespective of whether they
were server components or client components that will later on be translated to JavaScript.
The level of unification in the design that this framework allowed made UberFire an in-
credibly powerful framework.
Thanks to all the already existing components in the workbench and the fact that all com-
munication can be handled through events, extending components to listen to new events is
very simple and new components that interact with other actions taken by the user or the
server can be written with very loose coupled code.
Search WWH ::




Custom Search