ant elder wrote:
On Feb 15, 2008 11:01 PM, Jean-Sebastien Delfino <[EMAIL PROTECTED]>
wrote:
Raymond Feng wrote:
My preference is to keep PassByValue as the prefix for the following
reasons.
1) The invokers implement this interface only for the cases to enforece
pass-by-value for remotable interfaces. Invocations over local
interfaces (pass-by-reference) don't even care about this flag.
2) The allowsPassByReference() method basically tells if it's safe to
pass data as-is without violating the pass-by-value semantics.
Having a SomethingPassByValue interface provide an allowsPassByReference
method is really confusing IMHO.
I think we should use a consistent terminology with either passByValue
or passByReference but not a mix of both.
+1 just to add agreement that its quite confusing like this.
...ant
I can provide lots of suggestions about naming :-) but I'd like to
question whether we even need this new interface. Creating a new
optional SPI to set a single boolean seems quite heavyweight. There
are other examples in the SPIs of this kind of pattern and I think
there's a better approach that's lighter-weight and more flexible.
This boolean is effectively an optional property of the invoker.
As part of creating an invoker, a "property sheet" object could be
passed to the invoker's constructor for it to fill in with the
optional properties that it supports. This allows invokers to
add support for more properties in future without the need to create
a new SPI interface every time we need a new property. All that
is needed is to add new setter/getter methods to the property sheet.
The same approach could be used to add new properties for other
SPI objects such as binding providers and implementation providers.
In terms of naming (I can't resist), I think this boolean is saying
"I (the invoker) will handle PassByValue semantics". So my naming
suggestion for the method or property is "handlesPassByValue".
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]