aspose file tools*
The moose likes JSF and the fly likes JSF vs Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF vs Struts" Watch "JSF vs Struts" New topic
Author

JSF vs Struts

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Jan 10, 2002
Posts: 61612
    
  67

Do you really feel that the number of classes is a reasonable metric to use for measuring "better"?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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.


GenRocket - Experts at Building Test Data
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

Actually, the exact same argument was put forward by Graig MacClannahan. And he's one of the authors of Struts!


Customer surveys are for companies who didn't pay proper attention to begin with.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61612
    
  67

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

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

Joined: Oct 11, 2004
Posts: 3830
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??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF vs Struts