Actually, compilation would just be for a global webwork install. For
example, if you are looking for "blah.foo.bar" for BeanA or BeanB, you can
use the same parse tree:

Object blahFooBar = Ognl.parseExpression("blah.foo.bar");
Ognl.getValue(blahFooBar, beanA);
Ognl.getValue(blahFooBar, beanB);

So the parse only happens once and can be shared. So all we'd need need to
do is keep a Map of the expressions used and the parsedExpression Object and
they could be shared for the entire application.

-Pat

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Patrick Lightbody" <[EMAIL PROTECTED]>
Sent: Tuesday, November 05, 2002 12:48 PM
Subject: Re: [OS-webwork] Re: OGNL


> Pat,
>
> I have played around with OGNL in the past and found that the
> performance of the uncompiled queries were really slow.  If you
> compiled the queries they were fairly speedy. (which you showed run
> time results to support this, in a previous email)
>
> I know that BeanUtil currently does caching, but the caching is fixed
> per Bean.  Ie once you access the bean all methods are cached, and if
> you are accessing a sub field it uses the previously cached data.
>
> I believe, and I could be wrong, that OGNL precompiled queries would
> be unique for every combination of field/subfield/subsubfield, etc.
> That would require a new compilation step for every field
> combination, and would require that they are all cached, or it would
> be very slow.
>
> Wouldn't this have a negative real world affect on performance?
>
> Please correct me if I am wrong.
>
>
> Walt
>
>
> > On a related note, Ognl does have an expression language itself:
> >
> > Ognl.getValue("foo.bar", bean, ...) will evaluate getFoo().getBar().
Could
> > we take advantage of this? Ognl actually can accept a pre-compiled
> > expression (a Node object), so we could write a parser that that took
> > "foo/bar" and generates a Node tree that Ognl could use. This would
> > essentially equate to ditching our expression language in terms of
> > implementation and using Ognl. All we'd do (for compatability) is write
a
> > WebWork EL->Ognl expression parser. Just a wild idea I'm throwing out
> > there... :)
> >
> > For more info on Ognl's expression language, check out www.ognl.org. It
has
> > a HUGE ammount of power in there.
> >
> > -Pat
>
> *****************************************************
> Walter Szewelanczyk
> IS Director
> M.W. Sewall & CO.        email : [EMAIL PROTECTED]
> 259 Front St.            Phone : (207) 442-7994 x 128
> Bath, ME 04530           Fax   : (207) 443-6284
> *****************************************************



-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to