longevity

A Persistence Framework for Scala and NoSQL

View project on GitHub

declaring the domain model

Before we start building out the elements of our domain, we want to declare the domain model as a type. We call it SimblDomainModel, and decorate it with a @domainModel annotation:

package simbl.domain

import longevity.model.annotations.domainModel

@domainModel trait SimblDomainModel

The @domainModel annotation does not do anything to our SimblDomainModel trait itself. Instead, it inserts some useful behind-the-scenes information into the SimblDomainModel companion object. The user manual has all the details of what goes on behind the scenes.

prev: modelling our domain
up: getting started guide
next: building the user aggregate