Likewise Struts is the view part of the MVC model, you still have to code the control and model parts yourself. Actions are not the controller part, they are a the link between the view and the controller.
The reference article states the following advantages of Struts:
- Centralized File-Based Configuration. Just like a regular J2EE application then, with it's web.xml.
- Form Beans. Not exactly difficult to code up yourself and what Struts gives you doesn't really utilise a lot of re-use.
- Bean Tags. OK, so struts gives you this tag library and a few other cool tag libraries, but they are trivial to implement and could easily be put in to a re-use library within your own company.
- HTML Tags. Ditto.
- Form Field Validation. Yeah OK, pretty useful, but have you seen the implementation? What a mess.
- Consistent Approach. As I said in one of my earlier comments, you still have to code a lot of stuff yourself, consistent approach is about programming in a sensible fashion. Further more, templating engines (e.g. velocity) and MDA are becoming used more extensively, and these provide a consistent approach. Struts does not actually enforce any kind of consistency. The configuration is a mess and actions are simply Servlets with a different name.
I really feel it is a waste of time getting up to speed with Struts. You're going to lose focus on real programming and become swamped by messy configuration and inappropriate framework code when there already exists a simple and effective framework in the form of Servlets and JSPs. The only good frameworks are the ones that encourage good programming practices and almost feel as though they are an extension of the language, or a filler of the gaps in the language. (Yes, of course I am talking about OSGi)
That all said, I have no experience with Struts2. Does the same spaghetti configuration exist? Are actions still bloated, glorified Servlets? To be honest, I can't even be bothered trying to find out!
In conclusion, Struts (like other bloated frameworks, read Hibernate) are a waste of time and just add unnecessary overhead and footprint to any project. Get back to basics and keep things simple. Think about re-use as you write your code and you will end up with a "framework" that works for you and your company, but don't go looking to create one!
1 comments:
I know that there is some zero-configuration option in Struts-2, but I've yet to try it out:
Struts 2 Zero-configuration
Results Annotation
Post a Comment