Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes Rule of thumb with Struts (for Neal Ford) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Rule of thumb with Struts (for Neal Ford)" Watch "Rule of thumb with Struts (for Neal Ford)" New topic

Rule of thumb with Struts (for Neal Ford)

James Drinkard

Joined: May 30, 2002
Posts: 19
I just started using Struts at work. I've completed two simple tutorials using struts and wondered if there is a rule(s) of thumb on when to use them? I wanted to use them in my next web project, but I was told if you don't have many jsp's it's not a good idea to use a framework. I disagree but was thinking maybe the overhead with struts on an app with only 5 or 6 pages makes it a bad choice?
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

It's not necessarily a bad idea, especially if you're already comfortable with using the framework. Even with just a few pages, you can still save some time by using a framework if you've already used it before. Besides, many IDEs now have wizards that will take care of most of the setup for you. Some other things you might want to consider in deciding whether or not to use a framework:
1. How comfortable are you with using the framework? If it takes you longer to get up and running because you are still learning the ins and outs of setting up and using the framework, then it might not be worth the trouble. Besides, it probably won't be all that hard to switch to using the framework later when you have had more time to delve into it.
2. Is this web app going to grow? If so, at what rate? If you don't think it's going to get any bigger than 5 or 6 pages then a framework will probably be overkill.
3. How complicated are the pages going to be? How much/how often are they going to change? If you think they will change often or if they are complex, you'll probably want to get a good separation of concerns: separate model, view, controller and database access layers. Frameworks help you structure your application that way from the onset. Of course, you don't need a framework to do it but it helps.

Junilu - [How to Ask Questions] [How to Answer Questions]
Neal Ford
Ranch Hand

Joined: Oct 23, 2003
Posts: 82
I think Junilu's second point is key: small apps that do useful work tend to grow out of control.

Neal Ford<br />Author, <i>Art of Java Web Development: Struts, Tapestry, Commons, Velocity, JUnit, Axis, Cocoon, InternetBeans, WebWork</i><br /><a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Rule of thumb with Struts (for Neal Ford)
It's not a secret anymore!