commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <>
Subject Re: [all] Expression API?
Date Sun, 06 Apr 2008 20:43:17 GMT

--- James Carman <> wrote:

> The concept of an "expression" comes up within a lot
> of contexts.
> There are various ways to define/evaluate an
> expression, currently,
> but there's no standardized API way to deal with
> them.  I was trying
> to come up with an API, but I don't know where it
> should belong.
> Should it be part of Lang, BeanUtils, or its own
> project.  Here's the
> basic idea:
> public interface Expression
> {
>   public Object getValue(Object rootObject);
>   public void setValue(Object rootObject, Object
> value);
> }
> This is similar to the way OGNL thinks of things
> except they "compile"
> their expressions into some nebulous "tree" object
> (no API, just
> represented as an Object) and you then use the
> static methods on the
> Ognl class to get/set values using that tree.  The
> way I see it, this
> interface could be implemented in a variety of ways
> JSTL-EL, reflection, Javassist, etc.).  So, what I'm
> looking for is a
> home.  Where should something like this belong? 
> Does it even belong
> in Commons at all, since it's a "framework" (it
> could be argued that
> Proxy is a framework much like this too, though)? 
> Thoughts anyone?
> This idea came up when discussing the concept of
> "recording" this
> expression using proxied root objects (similar to
> how mock testing
> frameworks do it).  I have the logic to record
> invoked methods using
> Commons Proxy, but I need a way to generate
> expression objects that I
> can then evaluate later.

I'm still hoping to bring Morph on board soon, and its
current codebase contains several facets including a
Language abstraction.  I really think there's some
overlap there with [el], but another piece of Morph is
its Reflector APIs which are similar to BeanUtils'
DynaBean, and I'm thinking the Reflector APIs could go
far toward providing a useful abstraction to plug
arbitrary object types into expression evaluators.


> To unsubscribe, e-mail:
> For additional commands, e-mail:

You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message