Hi struts folks,

Let me preface this by saying, I haven't played around too much with Struts
but I have used some homegrown web MVC frameworks that work in much the same
way (from a Controller perspective, anyway).  So if I am missing something
obvious about Struts, that's why...

Anyway, I have a couple of concerns with Struts as a controller,
specifically the ActionServlet and Action classes, and would really
appreciate your insight.

1) "Object explosion" for large sites--1-to-1 mapping of URLs to objects can
lead to hundreds of small classes. It really bothers me that Struts
encourages this kind of situation. Although the DispatchAction helps a lot. 

2) Meaningless method signatures, like execute(Mapping, Form, Request,
Response). All the methods look the same, regardless of what data they're
actually expecting. This often makes it necessary to go into the Java code
just to figure out what data a method uses. Not to mention losing
compile-time type checking. 

I have been doing front-end web development since 1996, and doing it in Java
since 2000, and in all that time I have never built a presentation tier that
I would consider both large and clean. It just seems like as websites get
bigger and bigger (the site of the company I'm working at has 738 at the
moment) there is no way to avoid "throwaway" code (i.e. at least one method
per request that does little else but service that request). I got so sick
of it that I am no longer in web development, instead I concentrate on the
backend transaction processing. 

Being a Java/OO purist, I really don't like it when 738 type-unsafe,
throwaway objects (or methods at least) make their way into the Java object
model. I have grown to recognize that large amounts of such code are
necessary in any large website, but if I can help it I would like to keep it
out of the Java source for the above reasons. 

I have started writing some code that pushes the messy code out of Java and
into an XML file not unlike the struts config file. However, I've only just
begun really concentrating on this problem, and don't have any experience
working with Struts in the real world, so I was hoping to hear some thoughts
on the subject before sinking much more time into it. 

Do you agree with my two complaints? If not, why? If so, can you think of
any way to ease the pain and stay within the Struts framework?

Thanks,
Joe Cheng

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to