getting things like loggers into the model
Caleb Cushing <[email protected]>
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <CAAHKNRHogcmtY-x3OnyuQd-TK9A9g=0f4s8sO9Epx4Gzrnenyg@mail.gmail.com> |
So I asked this question on StackOverflow and the basic answer I've
been getting comes down to using an anemic model (or at least that's
my interpretation of people saying my entities should not have
business logic)
http://stackoverflow.com/questions/21743823/cdi-injecting-services-into-jpa-managed-entities/21749132
My example uses a Setter, but that's really a side effect of me trying
to use an exceptionally stupid example so that it's easily understood.
my basic desire is to be able to have access to things like a logger
in the model, largely for debugging purposes, or to fire events that
can be then tracked by some external class.
what I'm thinking right now is
Repository {
@Inject
Logger
@Inject
Event
...
AggregateRoot.wireServices( Logger, Event );
and then passing it through the model
However other idea's are welcome.
--
Caleb Cushing
http://xenoterracide.com
Calendar:
https://www.google.com/calendar/embed?src=xenoterracide%40gmail.com&ctz=America/Chicago
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/domaindrivendesign/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/domaindrivendesign/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo Groups is subject to:
http://info.yahoo.com/legal/us/yahoo/utos/terms/