Repository and Entity in separate projects?

21 views
Skip to first unread message

Anton Hughes

unread,
Aug 22, 2015, 12:06:43 PM8/22/15
to Sculptor Generator
Hello

I am working on a multi-maven sculptor based project. The basic structure is:

  • Shared - common domain objects
  • Service - server application for persisting domain objects
  • Client - client library working with services using common domain objects.
I would like to define my entities in the shared project, and repositories in the service project. However this does not seem to be possible, as Sculptor expects a repository to be defined inside an entity. 

Or, is it actually possible?

Thanks

Torsten Juergeleit

unread,
Aug 24, 2015, 3:56:54 PM8/24/15
to Sculptor Generator
Sculptor is about DDD. In DDD repositories are used to access aggregate roots and aggregate roots are entities. This is the reason for defining a repository within the corresponding aggregate root entity in Sculptor models.

So if you don't like Sculptors way of generating entities and repositories together then you can extend / override the corresponding Sculptor templates, e.g. RepositoryTmpl.

/Torsten
Reply all
Reply to author
Forward
0 new messages