Hi all,
I am fairly new to Spring RCP, and its taken a while to bring myself up to speed on how it all fits together. I am impressed by what I see - it is clear that a lot of work has gone into making a sophisticated client-side framework.
One thing I found lacking was an approach to querying data sources for domain objects. By that I don't mean a data-access layer API such as what exists in the main Spring branch, but more of a stronger, domain-oriented query API.
My thoughts on this are that Spring-RCP could benefit from the definition of a query API similar to eg. Hibernate's Criteria API, but with a focus closer to the view or the domain model than the data-access layer. That is to say, it would be an object-oriented model of a query that allows one to express constraints on domain properties and paths.
But how to go about it? Some initial suggestions are:
1) A QueryModel interface (similar to or extending FormModel ?) bound to a type (ie. a domain class), with an abstract implementation for JavaBeans.
2) Support for setting constraints upon that QueryModel, conceptually similar to constraints in traditional query languages like SQL or XPath, (this would re-use the existing Constraints and Rules API).
3) (Abstract) methods within the QueryModel to invoke the query (how this is handled will be up to the developer), and returning an ObservableList or a PageableList. The latter would retain a reference to the QueryModel and invoke it upon 'next page' or 'previous page' commands.
3) Translation classes within the main Spring branch to convert such a QueryModel (or its set of constraints) into the query APIs of the different ORMs (or JDBC) supported by Spring. I have already mentioned Hibernate's Criteria API, and I presume similar concepts exist within JDO, OJB, etc.
If anyone has any thoughts on this I would be interested to hear them.
regards,
Scott Russell


Reply With Quote