CHAPTER 3Understanding Domain Classes

Object-oriented (OO) applications almost always involve a domain model representing the business entities that the application deals with. Our gTunes application will include a number of domain classes including Artist, Album, and Song. Each of these domain classes has properties associated with it, and you must map those properties to a database in order to persist instances of those classes.

Developers of object-oriented applications face some difficult problems in mapping objects to a relational database. This is not because relational databases are especially difficult to work with; the trouble is that you encounter an "impedance mismatch"3 between the object-oriented domain model and a relational database's ...

Get The Definitive Guide to Grails, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.