Migrating from JSF to AngularJS

11,109

Solution 1

Maybe it's too late answer but I'll answer it anyway. JSF + Primefaces is a very mature solution since it's been around for a while. There is a very slight chance that you will face a JSf challenge that nobody else has faced before. So, you can get every kind of support of it online. Angular JS is just a GUI/frontend/clientside technology. Plus, you need to implement the backend yourself. e.g. to render a datagrid coming from the server. Yes, in JSF, you need to implement the backend too but with very less effort. It will automatically bind a list with a datatable. Also, Angular is good for single page apps but for enterprise, multipaged and complex logics(take a CRM as an example), you need a mature technology.

UPDATE: Primefaces has introduced a library for Angular. https://www.primefaces.org/primeng/#/

Solution 2

AngularJS is more modern framework than JSF and as you pointed out, it is client side. JSF is server side. Main advantage of the AngularJS is faster responsiveness and easier development and maintenance. Basically, you don't need to learn so many technologies and frameworks to use AngularJS, which saves time and money. In JSF, there is much more technologies involved, e.g. you need to handle the navigation somehow (single-page AngularJS app is much more simpler). I think the main advantage of AngularJS is that it is server side independent. Basically, you can exchange the whole server implementation without touching the GUI code. On the other side, you cannot do this with JSF. You have to stay with Java.

Share:
11,109
niksvp
Author by

niksvp

Updated on June 04, 2022

Comments

  • niksvp
    niksvp almost 2 years

    I am currently using Primefaces v4 and JSF v2.1 in my application. While JSF being the server side technology, it sends all the html code and processing at the server and keeps the network too busy. Also, scalability is concerning. It keeps too difficult to scale up the application. i.e. for session replication and load balancing view objects are also required to be stored.

    I would like to upgrade the versions of JSF and Primefaces but the above lag tends me to move my view to AngularJS which holds its view at the client side and keeps the application server light.

    Would it be good to migrate to AngularJS or does JSF have any way to overcome this issue? What could be pros and cons of this migration?

  • Subodh Joshi
    Subodh Joshi about 8 years
    What if we are not working on Single Page Application Like Facebook or twitter ? If we have multiple pages? Complex UI with plenty of logic then also Angular is good to use? Any how you also know all web application are not the Single page. Now Suppose Bank Applications will you suggest to use Angular in place of JSF?
  • Lubos
    Lubos about 8 years
    Single page application doesn't mean there is really a single page. It means you don't have navigation from a page to a page, but instead you have a single frame where you swap the views.
  • Subodh Joshi
    Subodh Joshi about 8 years
    Please answer my other questions. Also don't compare Single page with Navigation
  • Aritz
    Aritz about 8 years
    Well, regarding maintenance, a complex Angular page could be a pain too. About development, it depends on programmer experience in Javascript and the way to work with DI. I find the answer quite subjective (it must be told that the question encourages subjectiveness, too).
  • Lubos
    Lubos about 8 years
    @SubodhJoshi - you can develop as complex application with AngularJS as you wish. I am on the big insurance project right now, where it has been decided to migrate from JSF to AngularJS. There is obviously reason for it. Personally, it is sometimes hell to work with JSF, sometimes it's even not possible to debug it - you get thousands lines of stacktrace. The main problem is not that it is server-side, but it's simply old and complex technology and it's far behind AngularJS. It's complex, because you usually have to use other technologies to fill some spaces like rich faces or spring webflow .
  • Subodh Joshi
    Subodh Joshi about 8 years
    @Lubos This is a reason to migrate from JSF to AngularJS because its old ? Then Java is more old So which new technology you are using in place of Java ? Are you sure -> Richfaces/Primefaces is any other technology which can be separated from JSF OR without JSF there is any future of RF/PF? You cant compare JSF with AngularJS or anyother JS framework.Even JSF 10year old then but from Last 10Year its top user community HOW? If it is that painful?Compare two JS framework it an be acceptable but comparing a server side thing with client side no meaning when you not full command over tech.
  • Lubos
    Lubos about 8 years
    @SubodhJoshi - Java is a programming language, not a web GUI framework, You are comparing 2 different things !! Programming languages last longer. Anyway, I don't say JSF couldn't evolve and it doesn't have its place, but today's direction is different. JSF is bound to Java, AngularJS is server side independent !! That means, you can completely change the server, because the whole logic is written in AngularJS. There is no code on server side, no programming language deployed on the server.
  • Subodh Joshi
    Subodh Joshi about 8 years
    @Lubos Oh Java is a programming language ,i am not aware about it its too old so i thought it have no market.Now how you can compare JSF(Server Side) with a JS(Client Side) framework ? It can be advantage then disadvantage as well but telling JSF such and JS is awesome totally wrong .If Google gave something it does not mean its a perfect tech. if its perfect why not they are using this to their own products? Why plenty of big DOM issue with i dont know even now in new release its resolve or not .
  • Kukeltje
    Kukeltje about 8 years
    People, please vote to close... this is exactely what SO is NOT for (as you should know @SubodhJoshi, since you are the expert
  • Subodh Joshi
    Subodh Joshi about 8 years
    Kukeltje Each and every SO user know, one and only one person is expert in JSF its no one else but @BalusC May be he is give some more light on this issue.
  • Lubos
    Lubos about 8 years
    @SubodhJoshi Please stop discuss about this. It doesn't make sense to write so many comments under my post, nobody will read it anyway. Kukeltje is right. This is not the purpose of the SO.
  • Subodh Joshi
    Subodh Joshi about 8 years
    @Lubos SO is not for this but even then you given answer of a off topic question any way rules always be impose to other not our-self.
  • snakedog
    snakedog over 5 years
    I apologize for adding to a topic that is clearly painful to many, and I agree this is not what SO is intended for, but with great respect I still find this discussion very helpful even if it is not a specific answer to a specific question. I wish it were lengthier. I am am deep into Primefaces, considering alternatives for exactly the reasons the OP brings up, and know nothing of Angular yet. What, then, is the proper place to post clear, respectful, subjective opinion (no exclamation points please), and personal experience with technology trade-offs?