commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rune Johannesen <rune.johanne...@digitalrum.com>
Subject [BeanUtils] - Some thoughts on query languages including beans
Date Tue, 06 May 2003 10:47:28 GMT
Folks,

I've spent some time looking at the options for querying nested bean
properties. Here are some of the findings:

 * The existing nested querying in BeanUtils (although limited to bean
properties only)
 * The OGNL project (Object-Graph Navigation Language, see
http://www.ognl.org/), also allowing queries in pure methods
(non-bean-property methods)
 * The technique for purely dotted queries (also allowing queries in
arbitrary container-like structures)
 * The JXPath project (http://jakarta.apache.org/commons/jxpath/)

The evolution of different standards on this arena challenges the BeanUtils
project and its modularity in several ways;

 * the classes that abstracts the clients from the java.beans package are
highly reusable (the stuff that covers the details like indexed properties,
mapped properties, array properties etc.)
 * the DynaBean and DynaClass appears to be quite proprietary to the
BeanUtils project - what about making it an optional extension / plugin?
 * a clean separation between interface and implementaion would allow more
reuse and flexibility
 * the core bean properties utilities and the query languages (access
syntaxes) must be separated, i.e. the same data structure could be queried
using different query languages

Here are some lines of pseudo-code to examplify the high-level
interface/implementation separation:

	public interface AccessLanguage {
	    Object get(String pObject, String pQuery);
	    void set(String pObject, String pQuery, Object pValue);
	}

	public class JXPathSyntax implements AccessLanguage {
	    ...    
	}

	public class DottedSyntax implements AccessLanguage {
	    ...    
	}

	public class DynaSupportSyntax implements AccessLanguage {
	    ...    
	}

This would allow a variety of pluggable modules to co-exist in the BeanUtils
project and eliminate some of the difficulties the project faces in terms of
scope definition, I think.



Cheers,

Rune Toalango

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


Mime
View raw message