AngularJS + CDI = AngularBeans
Join the DZone community and get the full member experience.
Join For FreeEven in the highly volatile world of JavaScript frameworks, AngularJS is still very clearly leading the pack. The good news for Java EE developers is that Java EE generally and Java EE 7 in particular works extremely well as a back-end for frameworks like AngularJS. To see why this is you need not look much farther than my talk on the topic and the corresponding example code(the code is deliberately self-contained with setup instructions so that you can explore it in detail on your own).
One of the drawbacks of the JavaScript rich client approach is that it often involves some boilerplate code that does not exist in server-side web frameworks due to the remote communication layer involved. To borrow concepts from the old J2EE design patterns, this boilerplate involves the creation and maintenance of DTOs (Data Transfer Objects) and remote proxies, not to mention the plumbing code necessary for the remote communication. If you look carefully at my code example the boilerplate is not that hard to spot. One way of avoiding this boilerplate is a tight binding layer with the underlying back-end technology that automatically generates the DTO, remote proxy and remote plumbing parts. In the process the binding layer can bring a lot of back-end features forward to the client as well.
Fortunately for the Java EE ecosystem, my good friend Bessem Hmidi has formulated just such a solution focusing on CDI as the back-end component model. He has aptly named his project AngularBeans and first release is now on GitHub for everyone to use. His simple hello world example speaks volumes as to the power of this solution. Beyond simply removing boilerplate AngularBeans does far more (look at the GitHub page for full details):
- Bean Validation on the client side
- Built-in internationalization support from server-side property files
- SockJS support
- Server-side event binding
He has a more comprehensive example that demonstrates all the capabilities of AngularBeans. The project is at a very early stage, so this is a great time to get involved! In particular Bessem is looking to improve the project documentation.
On a slightly separate note, Bessem is the JUG leader of the ESPRIT JUG in Tunisia. He is one of the key Java EE advocates in North Africa, along with the likes of Egypt JUG leader Mohamed Taman. Bessem and I both very recently spoke at the inaugural Voxxed Days Algiers, Algeria (expect the trip report from that great event soon!).
Published at DZone with permission of Reza Rahman, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
How To Scan and Validate Image Uploads in Java
-
Security Challenges for Microservice Applications in Multi-Cloud Environments
-
A Data-Driven Approach to Application Modernization
-
Constructing Real-Time Analytics: Fundamental Components and Architectural Framework — Part 2
Comments