jstrachan | 29 Jan 08:20 2005

Re: Builder ideas

Matthew A. Miller wrote:
> I mostly agree with John.  If anything, 'with' could look for some 
> marker interface or annotation to determine if the block should use 
> static- or dynamic-dispatch (e.g. Dispatchable, Dynamicable, or 
>  <at> dynamic).  The statically-dispatched builders would be nothing more 
> than traditional pojos, while the dynamically-dispatched builders would 
> always go through their invokeMethod/getProperty/getField/etc.

Agreed - though rather than annotations or interfaces the compiler can 
just decide if it knows the type of the builder or not. (i.e. choose to 
use static or dynamic method invocation based on its knowledge of typing).

I think the main use of an interface in the case of builder/markup is 
mainly to separate out the 'generic XML' types of builders from the 
'specific schemas/methods' types of builders. (e.g. something which 
parses a DOM of any-old-XML versus something which lets you create Swing 
widgets of which there's only a certain number of allowable methods)

> Just a thought, and maybe not a good one...

:) Its a good thought, thanks.