Could one instead use a stack for the chain Context and then derive your
current context from the stack depth (or chain length) and/or contents?  
Actually (stream of conciousness beginning), might we even better register a
listener that will automatically execute when a certain Context chain is
created?  For example, when you register a context listener, you say you
want to execute whenever there is a Context chain assembled that has a
certain combination of elements in a certain order.  
Of course, now that I think of it, none of this solves the problem of "who
goes first?"  
Unless one enforces only one listener per unique combination.  Then, of
course, you would enforce the notion that you can only add a listener to the
end of the chain and never somewhere in the middle.  Perhaps even allowing a
wildcard to say "I want to be attached to any chain that begins with
httpservletrequest" and let the chain assembler do everything in the proper
order.  (I.E. the aforementioned would always go before something that
wanted httpservletrequest AND httpservletresponse).

Just my $.025 (those half cents add up)

-----Original Message-----
From: Joe Germuska [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2003 11:02 PM
To: Struts Developers List
Subject: RE: ActionForwards, et al (was SuccessAction)

At 9:07 PM -0400 8/12/03, Byrne, Steven wrote:
>I guess I have to reiterate what others have said earlier today: how do
>you deal with handling or enforcing composition order?  I.e. are you
>implicitly assuming/requiring that the various elements in the chain are
>orthogonal with respect to changes in the input/output "stream" or
>changes in state that other elements in the chain might have visibility
>into?  Or do you assume that the composition order is part of the
>interface specification, document accordingly, and hope that your
>clients will read and follow the ordering specification?

Ted H more or less suggested this, but I think the way to go is to 
give each command an opportunity to validate any contract 
pre-conditions, like expecting certain beans to be defined in the 
context.  You could even just leave this up to the command author to 
do in the main execute method, but it might promote good practice if 
it were explicitly in the API.

Joe
-- 
--
Joe Germuska            
[EMAIL PROTECTED]  
http://blog.germuska.com    
"If nature worked that way, the universe would crash all the time." 
        --Jaron Lanier

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


This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.



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

Reply via email to