Title: Struts (MVC) Shortcomings?
|
That
is the very thing I want to avoid for the long term. I most definetly can extend
struts no doubt. But, the problem arises when I extend struts and then I find
another set of classes that are useful and then I extend it again and ...
on and on. I have been in this boat already. The idea is to bring modular
code into the struts environment and assemble them without having to extend the
ActionServlet or Action class every time you do so. There are several
problems that can arise from taking the extending approach all the
time.
For example I used strutsx image button capabilities and
extended the struts base Action class. Then I created an internal security
mechanism that mapped roles and groups to Action classes within the struts.xml.
This then extended strutsx ExtAction. Suddenly, I was two
emanations from the base Action class (Action -> ExtAction ->
PhaseExtAction) with non-standard struts stuff. My code was then tied to at
least one extended Action class that does not have a good support base. What
wound up happening was that the strutsx never went anywhere and a more standard
solution came up. Now I have to go back to all my code and remove the extensions
and dependencies. This doesn't seem to me to be good modular coding
habit.
So, I
guess what I am saying is that for now I will extend the struts Action class. I
am also making an enquiry to the struts community to see if this sounds like
something that has value and longevity. Reusable processing modules mapped to
various Action classes through an xml file is kind of a combination of Filters
and Beans. I figured that the Filter would have to fit an interface and
could process common data prep needs that either face simple conditional
requirements or none.
Brandon Goodin Phase Web and Multimedia P (406)
862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws
-----Original Message----- From:
Jason Chaffee [mailto:[EMAIL PROTECTED]] Sent: Thursday, April
25, 2002 1:34 PM To: Struts Users Mailing List Subject: RE:
Struts (MVC) Shortcomings?
I have been working on extending struts mappings to allow me to pass in
information through the action mappings, but I always use on generic action
class. Struts is extensible, so you should be able to accomplish what you
want with a minimal amount of effort.
-----Original Message----- From: Phase Web and
Multimedia Sent: Thu 4/25/2002 12:25 PM To: Struts
Dev; Struts User Cc: Subject: Struts (MVC)
Shortcomings?
I am throwing this post out there in the hopes that it will
either spawn a solid answer or at least discussion towards addressing
these issues that I am facing with MVC/Struts. So, here I go...
It
is an issue I think is kind of addressed with Plugins but gives no
inline processing options.
The issue becomes one of preparing data
for the view without having to write an Action Class for every possible
page someone might view. For example I have a shopping cart and I have
dynamic content that is produced seperate from the shopping cart. The
dynamic content shows up side by side with the shopping cart content. I
would have to produce an Action class for that particular scenario in
order to prepare data for the shopping cart and the dynamic
content.
Wouldn't it be easier if there were a way to allow inline
processing, like an internal struts filter, that could be configured in
an xml file and would pass the request through a processing that could
prepare different data combinations without having to hardcode
everything.
So in my afformentioned scenario I would pass the request
through some filtering process (I imagine it would be an interface) that
is predefined in an xml doc and then provide the data to the page for
display. For many cases I wouldn't have to touch the action class.
Conditional info can be contained within the filters (a login bean of
sorts). The advantage of doing this over using Filters (2.3/1.2) is that
you can configure it within struts on specific Action Classes or maybe
url patterns and define the order of processing in an xml doc.
So
then you could produce a custom action class and assign common
processing to the Action class without having to touch a stitch of code
or use a generic class and give it common processing requirements. I know
this is probably an oversimplification. But, it doesn't seem entirely
impossible. I would be willing to work on this if I though it would be
possible to have it included into struts in the future. Also, if someone
is doing this already. I would love to get my grubby fingers on
it.
Brandon Goodin Phase Web and Multimedia P (406)
862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws
-- To
unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For
additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
|
winmail.dat
Description: application/ms-tnef
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>