Szegedi Attila wrote:
>
> I have enhanced the performance of dynamic cast functionality further. Now
> instead of doing a method-by-method traversal of superclasses and interfaces
> when populating the ClassMap, it does it in a single bulk traversal for all
> methods of the class. This is achieved by
> ClassMap#getAccessibleMethods(Class) method. I also couldn't resist
> tightening other parts of ClassMap code here and there a bit :-) (such as
> replacing equals with == when comparing Class objects etc.)
> So, forget the previous patch and use the one I send now. Umm... does
> anybody in fact review/commit/reject these?
>
I will do it today.
geir
> Attila.
>
> ----- Original Message -----
> From: "Stephane Bailliez" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: 2001. augusztus 3. 6:46
> Subject: RE: [PATCH] dynamic casting to avoid IllegalAccessExceptions
>
> Ok I'm convinced. :-)
>
> --
> St�phane Bailliez
> Software Engineer, Paris - France
> iMediation - http://www.imediation.com
> Disclaimer: All the opinions expressed above are mine and not those from my
> company.
>
> > -----Original Message-----
> > From: Szegedi Attila [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, August 03, 2001 9:18 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PATCH] dynamic casting to avoid IllegalAccessExceptions
> >
> >
> > There is no additional code (let alone Java code - this is not JSP!)
> > required in templates. The patch I submitted does all the
> > work inside the
> > Velocity engine. You still write only
> >
> > $entry.getKey()
> >
> > in the template. When first faced with an object of a
> > particular class,
> > Velocity's Introspector (in
> > org.apache.velocity.util.introspection package)
> > will create a ClassMap for that class that contains all public method
> > objects on that class. Various parts of Velocity use that map
> > to resolve
> > method names into method objects. However, due to my patch it
> > will no longer
> > place public-but-inaccessible methods in the ClassMap,
> > instead it will place
> > their public-and-accessible counterparts from a
> > superclass/interface. This
> > method resolution happens only once per class introduced to
> > velocity, and
> > not on each use of the method (except for those parts of Velocity that
> > currently do not use Introspector - hopefully they will in
> > near future).
> >
> > That's all it does.
> > It does not break the separation of code and presentation.
> > It does not introduce additional code in templates.
> > It just solves the problem: you can finally call interface methods on
> > non-public classes from a template.
> >
> > Attila.
> >
> > ----- Original Message -----
> > From: "Stephane Bailliez" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: 2001. augusztus 3. 2:36
> > Subject: RE: [PATCH] dynamic casting to avoid IllegalAccessExceptions
> >
> >
> > <snip/>
> >
> > I'm just wondering here where we should stop in macros..if we
> > continue like
> > this we'll type plenty of java code in the templates and I'm
> > not sure this
> > is a good thing. I think we'll completely break the
> > separation between code
> > and presentation if we do that.
> >
> > This is the dilemna we are somewhat facing here IMHO.
> >
> > > interfaces.
> > > - What if the object was not returned from a method but was
> > stuck into
> > > Context by code? You could assume only it's a java.lang.Object.
> >
> > > I hope I was able to convince you.
> >
> > You are definitely right if we decide to type a lot of Java
> > related code in
> > the templates just because Java does not support generic and
> > cannot have
> > typed collection. But is this good ?
> >
> > --
> > St�phane Bailliez
> > Software Engineer, Paris - France
> > iMediation - http://www.imediation.com
> > Disclaimer: All the opinions expressed above are mine and
> > not those from my
> > company.
> >
> >
> >
> >
>
> ------------------------------------------------------------------------
> Name: dynamic-cast.zip
> dynamic-cast.zip Type: Zip Compressed Data (application/x-zip-compressed)
> Encoding: base64
--
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
Developing for the web? See http://jakarta.apache.org/velocity/
Be well, do good work, and keep in touch.