On Wed, 2007-04-04 at 09:12 +0300, Cihat Altuntaş wrote: > You mentioned about developers that using higher level of code to hide > relational model. Can you show me an explain ? In that model Are Batis POJOs > have been using instead of DTO objects?
I would guess the most common approach is to use Abator to generate the iBATIS model and DAOs, and package that in a jar. Then pull that jar into your project and use the DAOs and models in a service/manager/facade layer to populate domain objects that are returned to the consumers of the service/manager/facade. The domain objects do not have to adhere to the relational model and can look quite different from the Abator generated iBATIS model objects. You could even put the server/manager/facade functionality within the domain objects themselves (this can lead to other problems with things like serialization and no clear lines of responsibility, depending on how you build things). If you don't use Abator, the idea remains the same. iBATIS doesn't force your domain model. iBATIS is very flexible and can map complicated objects in and out of relational databases. Also, the objects iBATIS maps don't have to follow the relational structures you have, you can do things like pull multiple tables together in a single query and map the resulting columns into a single Java object. Now, Abator's auto-generated model objects do mirror your relational tables, but there's nothing that says you have to use Abator's model objects as your domain objects. Cheers, Chris
