Existing domain model

3 posts / 0 new
Last post
ckotwal
Offline
Joined: 05/09/2009
Existing domain model

Hello,

Had a general question:

Does JSPresso support an existing domain model? We have an existing rich domain model in Hibernate, but were looking to put a UI on top of this. Could JSPresso be used for this with minimal change? Also could JSPresso be used with an existing RDBMS model to put a UI onto existing tables?

All the examples I have seen so far assume a new development with JSPresso having control of all layers. Apologies in advance in case I have missed out some docs.

 

Cheers,

-Chetan

ckotwal2
Offline
Joined: 05/11/2009
Any comments?

Just wondering whether anyone could comment on this?

I am trying to evaluate this framework against other frameworks like Wavemaker and Skyway which also do CRUD apps and compatibility with an existing domain model/RDBMS schema is one of the criteria that I am looking at to arrive at a decision.

 

I do like what I have seen with JSPresso as it seems to give me the ability to go out and do my own thing in case the default mapping does not work, but still cant seem to determine how it could reuse an existing hibernate model/schema, with some modification

 

Thanks,

-Chetan

 

vvandens
Offline
Joined: 05/29/2008
Existing domain model

Hi Chetan,

Thanks for your interest in Jspresso.
As you correctly understood it, Jspresso assumes control on the domain model layer. The main objective is to allow agnostic manipulation of entities (and components) for generic actions and internal framework features (like "in-memory", transaction-aware, unit-of-work).
I haven't done much work on how to deal with an existing Hibernate model and you may face problems that I don't forsee for the moment, so take it with care.

Having said that, and for the record, you will find below a list of the "implementation constraints" I can think of, that are put on the domain model for it to leverage Jspresso features :

  • entities must implement the org.jspresso.framework.model.entity.IEntity interface and particularly :
      * "id" property that is a synthetic key
      * "version" property that is the entity version for optimistic locking
  • components must implement the org.jspresso.framework.model.component.IComponent interface (a super-interface of the IEntity interface).
  • all entities and components must follow java beans conventions (i.e. fire property changes on all properties modifications including collections).
  • children entity collections must be accessed using modifiers (i.e. addToXXX, removeFromXXX where XXX is the child collection property) for their changes to be correctly handled.
  • reverse relationships must correctly be handled by the domain model property modifiers (i.e. setting a property must also update its in-memory reverse side if needed).
  • and of course, all components and entities must still be described using the Jspresso entity (or component) descriptors. This sementicaly rich description is needed by the other layers.

Don't hesitate to post back if you have any further questions.

Hope this helps,
Vincent