I'm working on a project in which we are trying to apply both domain-driven design and REST to a service-oriented architecture. We aren't worrying about 100% REST compliance; it would probably be better to say we are trying to build resource-oriented HTTP APIs (~Level 2 of Richardson's REST maturity model). Nevertheless, we are trying to stay away from RPC-style use of HTTP requests, i.e. we attempt to implement our HTTP verbs according to RFC2616 rather than using POST
to do IsPostalAddressValid(...)
, for example.
However, an emphasis on this seems to be at the expense of our attempt to apply domain-driven design. With only GET
, POST
, PUT
, DELETE
and a few other rarely used methods, we tend to build CRUDdy services, and CRUDdy services tend to have anemic domain models.
POST
: Receive the data, validate it, dump it to the database. GET
: Retrieve the data, return it. No real business logic there. We also use messages (events) between the services, and it seems to me that most of the business logic ends up being built around that.
Are REST and DDD at tension at some level? (Or am I misunderstanding something here? Are we maybe doing something else wrong?) Is it possible to build a strong domain model in a service-oriented architecture while avoiding RPC-style HTTP calls?
IsPostalAddressValid(...)
would fit in with "Providing a block of data, such as the result of submitting a form, to a data-handling process"?