|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Distributed versus local processing
Alaric B. Snell wrote:
> But metadata extraction code I've writ for Java looks like:
>
> link = getLinkFromSomewhere () // you missed this out in the HTTP one
>
> Class c = link.getClass ();
>
> boolean idempotent;
>
> try {
> idempotent = c.getField (methodName + "IsIdempotent").getBoolean (link);
> }
> catch (NoSuchFieldException e) {
> // There was no explicit flag, assume not idempotent for now
> idempotent = false;
> }
If the objects implemented an interface, you could just use a cast:
try
{
Idempotent i = (Idempotent)getLinkFromSomewhere ()
...
}
..
and avoid all that reflection verbosity.
> Reflective programming languages make this explicit!
Not as explicit as a cast/classcastexception block - which is what
you're doing deep down.
Bill de hÓra
--
Propylon
www.propylon.com
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








