struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Graham" <dgraham1...@hotmail.com>
Subject Re: subclassing frustrations
Date Thu, 05 Dec 2002 22:06:57 GMT
I agree that Struts needs more interfaces.  I think some classes aren't 
interfaces to force you into good design (ie. your form beans can't be model 
classes).  I disagree with that approach and find it somewhat condescending 
to experienced programmers.

My approach would be to make many things interfaces with some standard 
implementations to allow easier extensibility.  This would also allow people 
to design poor systems if they abused this freedom.

David






>From: Erik Hatcher <jakarta-struts@ehatchersolutions.com>
>Reply-To: "Struts Developers List" <struts-dev@jakarta.apache.org>
>To: Struts Developers List <struts-dev@jakarta.apache.org>
>Subject: Re: subclassing frustrations
>Date: Thu, 05 Dec 2002 15:55:16 -0500
>
>Jason Rosenblum wrote:
>>Erik,
>>
>>One simple hack is to layer your base Actions on top
>>of the pre-defined Actions. You could change your
>>Struts code such that LookupDispatchAction subclasses
>>BaseAction or BaseAdminAction. It's not convenient but
>>it should work.
>
>I'm not sure I follow.  To invert the inheritance (without modifying Struts 
>itself) would require me to copy LookupDispatchAction into my code (and I 
>did this, as BaseLookupDispatchAction) and have it subclass from my primary 
>base class, such as BaseAction.
>
>Or are you suggesting something other than this?
>
>>Actually, it would be a nice feature if you could
>>supply Struts with the type of your Action class, but
>>i guess this would only work if there was an Action
>>interface and an Action factory to create different
>>implementations.
>
>Yeah, there are lots of ways to accomplish this, but at the very least an 
>Action really should simply be an interface since its stateless and the 
>idea is to just implement execute() yourself anyway.
>
>I haven't thought through how this should be done differently, just that 
>this situation is currently frustrating.
>
>	Erik
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:struts-dev-help@jakarta.apache.org>


_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message