Hibernate on the other hand, which is the technology used by Grails, encourages developers to create the domain models first, and then generate a migration for the database (using SchemaUpdate.) The focus of the developer work is on pure domain modeling.
Given that the focus of the ActiveRecord approach is on the structure of the domain models as persisted in the database, I call it Database-Driven. On the other hand, since the Hibernate approach puts the focus on pure domain modeling in the programming language, I call it Domain-Driven.
Is either approach better than the other?
While, it is generally a matter of personal taste, there are potential trade-offs.
Benefits of the Database-Driven approach over the Domain-Driven approach are:
On the other hand, benefits of the Domain-Driven approach over the Database-Driven approach are:
Which approach do you prefer and why? It would be interesting to learn about other trade-offs between the two approaches.