X

An Oracle blog about Java Technology

AngularJS + CDI = AngularBeans

Guest Author

Even 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!).

Join the discussion

Comments ( 15 )
  • Mohamed Taman Friday, May 29, 2015

    Thanks very much, great post by great friend, congratulation Bessem


  • guest Wednesday, June 3, 2015

    Proud to say that mister bessem was my tutor


  • Radhouane mhamed Wednesday, June 3, 2015

    Congratulation Mr Bassem


  • Nejmeddine Wednesday, June 3, 2015

    Congrats Mr Bessem !


  • Boussabat Asma Wednesday, June 3, 2015

    Proud of you


  • Hechmi Wednesday, June 3, 2015

    keep up the good work Mr Bessem


  • hamed Aymen Wednesday, June 3, 2015

    proud to be one of your students Mr Bessam


  • guest Thursday, June 4, 2015

    one of excellent Java EE trainers, Congrats Mr Bessem


  • rayaane belgasmi Thursday, June 4, 2015

    The best professor ever we are proud of you congradulations you honnored us.


  • guest Thursday, June 4, 2015

    Nice Job Bassem, keep on working


  • mohamed chebbi Thursday, June 4, 2015

    Nice job mr.bassem


  • beligh.hamdi Thursday, June 4, 2015

    Good luck Mr Bassem


  • Jaafar Hamza Friday, June 5, 2015

    Congratulation Mr Bassem


  • Rami Hedfi Saturday, June 6, 2015

    Well Done ! congratulations Sir :)


  • guest Saturday, June 27, 2015

    you are a big prof.

    Congratulation Bassem


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.