> -----Original Message-----
> From: Simon Nash [mailto:n...@apache.org]
> Sent: Thursday, December 09, 2010 10:20 AM
> To: user@tuscany.apache.org
> Subject: Re: Elementary question about Scopes
> 
> Millies, Sebastian wrote:
> > Yes, I see the point about callbacks.
> >
> > With regard to the other, cosmetic differences, what you regard as
> ugly, I
> > regard as good programming practice. To me, instance variables
> represent the
> > state of an object, in particular mutable state. If there is no such
> state,
> > I find it much clearer to pass parameters as method arguments rather
> than
> > to store them in instance variables.
> >
> With STATELESS scope, the object instance == the individual service
> request.
> Therefore it is completely appropriate to store data relating only to
> the
> individual request as instance variables of this object.
> 
>    Simon
> 
[snip]


I believe it's only a matter of taste. After all, all the "data relating 
only to the individual request" already come in as service method parameters.

As different methods have different parameter sets, copying the top-level
method parameters to instance variables makes for code which I find hard to 
read, because in methods lower in the call hierarchy, I cannot easily see 
which part of that "request state" is really relevant. 

In contrast, I can see that immediately from a method signature, when all 
relevant parameters are threaded through the call tree. 

-- Sebastian

Reply via email to