commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject [all] Expression API?
Date Sun, 06 Apr 2008 18:29:10 GMT
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 (OGNL, MVEL,
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.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message