• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF vs Struts

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I found one advantage of JSF compare to Struts till now...

JSF framework requires less number of classes compare to Struts. Because, JSF has combined data and actions into one class called managed bean.

For example, if a form has 3 buttons (actions), Struts will require 3 Action classes to handle them and a Bean class (I guess, ActionForm) for holding data. But in case of JSF, one class will hold both data and all 3 actions...

Right??

Please put any practical pros/cons, you feel any framework has over other...

Thanks.
[ July 19, 2006: Message edited by: rathi ji ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you really feel that the number of classes is a reasonable metric to use for measuring "better"?
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yea, what Bear said. And I don't really like either framework. ;) Struts vs JSF has been discussed many many times. Do a search in this forum, the struts forum, and Google and you'll find all the pro's and con's you need.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18226
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, the exact same argument was put forward by Graig MacClannahan. And he's one of the authors of Struts!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wasn't arguing for the relative merit of Struts over JSF, or vice versa; like Gregg, I detest both.

I was merely pointing out that a mere count of the number of classes is a poor metric to measure anything by. Following that logic, the best software would be obtained by putting everything into one humongous class.

The number of classes is irrelevant next to how those classes are organized, how clear their structure is, if they represent a good abstraction of the problem space, and so on...
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Do you really feel that the number of classes is a reasonable metric to use for measuring "better"?


... but both are flexible enough, doing the same job so why to use one which has bunch of classes...

It's logical also, data and actions operated on that data are in the same class...
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
Yea, what Bear said. And I don't really like either framework. Struts vs JSF has been discussed many many times. Do a search in this forum, the struts forum, and Google and you'll find all the pro's and con's you need.



Yes, I can find. But I started this thread for one who is looking for pros/cons which people really feels/found (not necessary invented ) in their daily job...
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rathi ji:



Yes, I can find. But I started this thread for one who is looking for pros/cons which people really feels/found (not necessary invented ;) ) in their daily job...


And those pros and cons have been discussed, nearly to death. ;) That is why I suggested doing a bit of research. You are likely to find your pros and cons list quicker than waiting on people to reply with what they most likely have all said before.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One advantage of Struts over JSF.

If we want to add any funtionality in a page, then in case of JSF, we will have to change 'already sucessfully running' managed bean java file and then compile and test it again.

In case of Struts, don't need to change any already build java file... just add a new action class for new funtionality and map it into config file...

Right??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic