This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF and MVC

 
guru prasanth
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam doing assignment for part2.I can use JSF or i can use normal MVC (With serverlet as controller and jsp as model)
Iam very much familiar with Servlet/jsp combination i can design it pretty easy.I have read JSF but never really worked on it.I don't see a great advantage of using JSF although i appreciate what they have done.Infact my concern is that application performance can be slow becuase it's not a very tried and tested technology.Also there is a technolgical risk that there may not be many good devlopers of JSF.Moreover JSF is only specification and not implementation.So the performance of the application would depend on
implementation.Whereas Servlet/JSP is a tried and tested technology.Are the above statement justify my use of MVC using Servlets/JSP OVER JSF.Or just to be on a safer side shoiuld i use JSF.Also iam not sure how exactly to handle autherization/authentication using JSF.I can use filters but it's outside the life cycle of JSF.
 
Rajan Choudhary
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is what I learned from part3 exam today. You can suggest the solution you want but be prepared to answer, why that particular approach over others? I tried my best to convince the examiner why did I use JSF.

BTW, you can JSF phase listeners to use them as interception filters.
 
guru prasanth
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks rajan for your reply.But my question is slightly different.When will someone choose JSF over JSP/Servlets.
This is my thoughts.I want people to debate this point so that i can be sure about my decision.

1) If the application designed is going to be an ajax.Then we can use the partial submit use of ajax.
To decide if the application needs ajax or not the application needs have a dynamic UI where in one
page you can show mutiple things or mutiple edits in same page.

2) If the UI has too many reusable component then we can go for composite components.

3) Better separation of work between UI and java developers

These are the two things i can think of.I have just studied JSF and do not realtime expereince in JSF.So I want to know if there are more
advantage of using JSF than just this.

In MVC using Servlets/JSP these are the advantage

1) It's a tried and tested technology.There are more developers who have worked on this.

2) And lots of appserver implementing Servlets and jsp have improved their implementation over years.In case of JSF it's
an emerging technology and it depends on the implemetation like facelets and icefaces.Iam not sure if their implementation
is very stable.

3) Performance wise it wouild be good becuase there is not a overhead of any framework.Most of the framework like struts and Springs MVC is built of top of this framework.

Disadvantage of JSF.

1) No sure how efficiently the session handling coiuld be handled in JSF.

2) Lots of Javascripts are generated by JSF implemetations for field validation etc.Not sure how well these javascript will work across browsers.Also not sure how efficient will
these javascript be for complex validation.Again a lot would depend on the implementation

Disadvantage in Sevlets/jsp

1) The separation of work separation of work between UI and java developers

2) Code has to be exclusively be written for validaions(both business and UI validations conversions.It could add more to developemnt and testing efforts.

3) A lot would depend on the way it's implemented.Say a client side validation would be efficient with a good clientside java script code.But just choosing this Servlet/JSP does't
guarantee performance.

A better way i think couild be to use either a Struts or a Spring MVC.But can i do it for the assignent and give then the reason behind it.




 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure session handling is fine in JSF. Note that Sun/Oracle doesn't consider JSF an emerging technology anymore. (I don't either for that matter. There are many things I don't like about jSF, but it's been around long enough to be stable.)

I think your notes about components and AJAX are right on.
 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go for JSF when the SuD requires rich UI which cannot be given in Struts/SP. There are numerous components available already and you can write your own component as well. besides these componets can be reused. Peformance wise i havent heard anything negative about JSF. Another thing to be noted here is every componet is going to be stored an server side object in memory. Plus clear separtion of concerns. And finally your view code doesnt have to be coded in JSP. We can have customer renderers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic