|
When implementing new applicaiton with existing database schema, how should I define the domain model ? Should I define business entity for each different table, for example, if there are 2 tables: User and Item, should I create 2 POJOs, i.e, User.java and Item.java? Since how the table is defined reflects how the DBA thinks the data should be stored, it is different from how the business entity is modeled in business domain, this means that the business entity should not be the 'direct translation' of the table.(not a one-to-one relationship). Also how to handle this issue for legacy database?
Any suggestion is appreciated.
|