Domgen generates code from a simple domain model leaving the developer to focus on implementing high-value features of the application. The domain model is described using a domain specific language (DSL). Domgen then provides tasks that generate artifacts based on the domain model.

i.e. A developer may define a persistent entity in the DSL. A task could then be used to generate zero or more of the following artifacts from the domain model.

  • The SQL Server sql or Postgres sql to define the associated database table, keys, constraints, indexes and triggers.
  • Ruby ActiveRecord definitions that define the columns, constraints and relationships.
  • Java JPA entities that define fields for each attribute, constraints, relationships etc.
  • Java CDI beans that for querying and updating entities from and to the database.

This enables the user to get on with developing the application, and avoid focusing on the minutae of how to persist an entity to the database until there is a need. When the developer needs to customize how an entity is realized in the generated artifacts, the developer can annotate the domain model to guide the domgen generators.

Domgen also allows the developer to define the service layer and application messaging.

In summary Domgen consists of; Model Elements that define the types of things that domgen models, Generators that control generate artifacts from the model elements and Facets that allow customization of the generation process. The generation process is typically integrated with Buildr. Start with the Getting Started guide.