Re: Domain Model and Service Layer



First I have a hard time reading the responses using the new Google's
group interface - there is no tree view so I don't really know which
response comes where.
Sorry for that. I also hope that this post is addressed to me.

To be completely fair, the use of terminology on this question appears to
mix paradigms. I'm not sure which model you've picked. Can you please
outline your use of terms? Are you coding in an MVC or MFC model? Sorry
about that.

I'm using a DDD (domain driven design) terminology as far as I
remember it.

You refer to services, yet you did not reply to my other response on this
thread, so I'm left to guess if you are using a service oriented model for
the entire application. If you are, I answered in the prior message: you
call the e-mail service endpoint in a composite that you call at the point
when you wish to commit the creation of the user.

Services layer also known as application layer is a layer above domain
code. It is a kind of fascade over the system. It is not a service
oriented architecture.

I shall assume that you are not using that model, and thus the lack of
reply. In that case, the answer to your original question is to place the
business rules in the application layer. The decision of whether to send an
e-mail, or not, is clearly a business rule. In a single-component
monolithic model, business rules live in the app layer. In a distributed
system (SOBA) model, they live in composite services and rules-oriented
services.

According to DDD business rules should be kept inside the domain code.
That is also what my experience tells me - it prevents situations
where rules are bypassed.
I have moved with my questions to a more appropriate place as pointed
to me by someone here, but thanks anyway for your effort.

--
Michal

.



Relevant Pages

  • Re: Biz Modeling - lets try again
    ... then people try to put it in one layer or place and argue about where ... Expert systems can apply complex business rules. ... "if parent has kids, disallow deletion of parent". ... and GUI business rules in the GUI. ...
    (comp.object)
  • Re: Possible bug in Calendar
    ... java.util.Calendar is essential to that project to coordinate the various time zones involved, including business rules as to due dates, intervals between document submissions and the like. ... providing the localized user interfaces, including selection of which business rules to apply, but in the core logic classes I *hope* your Dates are all represented in one particular time base and that when the chosen business rules say "x is three days after y" it just adds 3*86400*1000ms to some number somewhere under the hood. ... It's still happening in a layer not far beneath the UI layer. ... Because if you've got mixed time-zones in the core data representations you've got big trouble on the way. ...
    (comp.lang.java.programmer)
  • Re: Possible bug in Calendar
    ... java.util.Calendar is essential to that project to coordinate the various time zones involved, including business rules as to due dates, intervals between document submissions and the like. ... providing the localized user interfaces, including selection of which business rules to apply, but in the core logic classes I *hope* your Dates are all represented in one particular time base and that when the chosen business rules say "x is three days after y" it just adds 3*86400*1000ms to some number somewhere under the hood. ... It's still happening in a layer not far beneath the UI layer. ... Because if you've got mixed time-zones in the core data representations you've got big trouble on the way. ...
    (comp.lang.java.programmer)
  • Re: Biz Modeling - lets try again
    ... then people try to put it in one layer or place and argue about where ... Expert systems can apply complex business rules. ... "if parent has kids, disallow deletion of parent". ... and GUI business rules in the GUI. ...
    (comp.object)
  • Re: Are the Hugo Award Winners Boring Examples of SF?
    ... to before committing to those responses. ... of oxygen before getting to the ones that are needed to pin down your final ... layer of precise exactness of nuance. ...
    (rec.arts.sf.written)