I'm trying to learn Domain Driven Design by example and I need your advice. Let's say I have an entity called Tender. I receive a Soap Message from outer service; the message has all the information about tender(tenderId, tenderSum, ...)
What I have to do:
- Receive a message with Soap Web Service and put the message to the message queue - done by Service
- Retreive the message from the queue - done by Service
- Go to the Database , retrieve a Tender object by tenderId or create a new Tender - done by Repository
- Fill the fields of the Tender object with the values from the Message - done by Domain Object Tender
- Save the tender to the Database - done by Repository
I tried to do it the correct way, but finally I find, that most of the code lives in Services, Repositories, etc. I'm really confused. What did I do wrong? Should I do all this stuff inside domain object ?