I have been playing with that idea for some time and I believe that a
plugable introspection engine should provide his own cache. This means,
of course, that a introspection engine factory should be defined and
that this one should be used to create an introspection engine instance
that should be placed in the internal context.
The default factory would just create an introspection engine instance
with the current introspection logic and current introspection cache.
Cache objects already need to be created in the context (AFAIK). This
way the introspection engine holding the cache gets created in the
context.
The performance impact of having such functionality in place will be
unnoticeable (something we already went trough in this list) and this
will ease the development of alternative introspection strategies.
Advantages:
- One can easily test new/alternative implementations of the
introspection without having to change Velocity's structure;
- Customization for different types of introspection (example: getting
fields instead of/together with properties, case insensitive, etc.);
- Customization for different resource needs (example: not using the
cache for an app with memory restrictions but low performance needs.
I also think its implementation is not that hard, and I am willing to
take a shot at it (already made some experimentation there).
Comments please.
Have fun,
Paulo Gaspar
> -----Original Message-----
> From: Jose Alberto Fernandez [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 11, 2001 21:05
>
> Interesting point!
>
> Of course, what we do in the referenceInsert() operation can be
> viewed as a
> variant of customized introspection (one in which there is an additional
> method call at the end).
>
> I guess we would have to provide access to the context in order for this
> kind of thing to be possible. And there is the issue of how this kind of
> thing will have to interact with our instrospection cache. And how to keep
> the internals hidden from the user API.
>
> I wouldn't want these to become some sort of open ended access to the
> internals that removes any change of redesign in the future. It would need
> very careful thought.
>
> Jose Alberto
>
> > -----Original Message-----
> > From: Paulo Gaspar [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, April 11, 2001 11:11 AM
> > To: [EMAIL PROTECTED]
> > Subject: RE: EventCartridge
> >
> >
> > Doesn't this sound as a nice place to place customized
> > introspection too?
> > =:o)
> >
> > Have fun,
> > Paulo Gaspar
.............