Sunday, February 01, 2009

JPA Annotations in Domain Model

Why I don't like them?

  1. It corrupts the domain object. Domain object doesn't have to know that it is meant for persistence to a relational database.
  2. Vis-a-vis Coherence, CacheStore that is meant to interact with an external data source is not necessarily meant for relational database. CacheStore could hook a database, a Directory server or even another Coherence cluster. @OneToOne has no sense if the external datasource is a Coherence cluster.
  3. Having a separate OR Mapping is much cleaner

No comments: