How to model in J2EE / JEE?

Posted by Harry on Stack Overflow See other posts from Stack Overflow or by Harry
Published on 2010-04-14T06:33:55Z Indexed on 2010/04/14 6:43 UTC
Read the original article Hit count: 181

Filed under:
|
|
|

Let's say, I have decided to go with J(2)EE stack for my enterprise application.

Now, for domain modelling (or: for designing the M of MVC), which APIs can I safely assume and use, and which I should stay away from... say, via a layer of abstraction?

For example,

  1. Should I go ahead and litter my Model with calls to Hibernate/JPA API? Or, should I build an abstraction... a persistence layer of my own to avoid hard-coding against these two specific persistence APIs? Why I ask this: Few years ago, there was this Kodo API which got superseded by Hibernate. If one had designed a persistence layer and coded the rest of the model against this layer (instead of littering the Model with calls to specific vendor API), it would have allowed one to (relatively) easily switch from Kodo to Hibernate to xyz.

  2. Is it recommended to make aggressive use of the *QL provided by your persistence vendor in your domain model? I'm not aware of any real-world issues (like performance, scalability, portability, etc) arising out of a heavy use of an HQL-like language. Why I ask this: I would like to avoid, as much as possible, writing custom code when the same could be accomplished via query language that is more portable than SQL.

Sorry, but I'm a complete newbie to this area. Where could I find more info on this topic?

Many thanks in advance.

/HS

© Stack Overflow or respective owner

Related posts about modeling

Related posts about j2ee