Re: WOAction Constructor
Re: WOAction Constructor
- Subject: Re: WOAction Constructor
- From: Q <email@hidden>
- Date: Fri, 12 Jun 2009 19:15:31 +1000
On 12/06/2009, at 4:17 PM, Andrew Lindesay wrote:
Hello Quinton;
Yes, I had imagined that. Do you think the responsibility for
creating the context in the action is significant?
Yes. possibly.
In contrast to component actions (which aren't WOAction's) that are
entirely context based by nature, direct actions and web services are
not. The request handlers for these actions don't really need to
concern themselves about a context or session to dispatch the request.
The context is of significance only within the scope of the action
itself (or rather within the scope of the WOActionResults returned by
the invoked action). By having the WOAction create the context there
is a guaranteed way to get access to the context that MAY have been
used to create the WOActionResults the action method returns. The
resulting WOActionResults isn't required to expose the context it is
using in any way, making it problematic to dispatch notifications or
errors using the context or session.
I'm working on some architectural-level changes to my JSON-RPC
system and so I'm just wondering if this is an arbitrary decision or
there is some significance?
I think the design choice is due to the context having no contractual
significance in the scope of a WOActionRequestHandler operating on a
WOAction, but is still of interest if a session was created or
something explodes while invoking generateResponse on the
WOActionResults returned from the invoked action. This way the
implementation details of how and when the WOAction creates the
context is not part of the request handler's contract with the action,
but it is still accessible if a context was used by the returned result.
--
Seeya...Q
Quinton Dolan - email@hidden
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden