0
votes

I have a very big application built with DDD (Domain Driven Design). A lot of heavy processes run in the IIS Pool and I would like to move 1 of those processes into a WCF (Windows Service Hosted). Those processes are async.

Current Architecture Layers looks like below:

  • Domain Layer (Entities, Domain Services)
  • Data Layer (Repositories, Mappings, Unit Of Work)
  • UI (MVC Application + WCF (With Http Endpoints))

The process it self generate lot of .PDF files and then send emails to every employee. Now, I need to attach additional files for every employee before sending the email and then do it. All this process for me must be in a WCF Windows Service (Windows Service Hosted) using TCP Endpoints capabilities behaving async.

What I am wondering if it is okay to publish the Domain layer like this throught internal services and understand if I am compliance with the DDD architecture by doing something like this. All the business logic remains in the Domain Layer.

I would need to send a list of employees to the tcp service from my Mvc Controllers and then use the domain layer to process everything.

Could anybody provide some guidance on this?

Thanks!

1

1 Answers

0
votes

Yes, I hope that the domain layer is in its own project because the WCF Service will need to reference that project as well as your MVC Application. Generally, domain objects are not marked as Serializable because this is an infrastructure concern so you may need to create Data Transfer Objects that you can pass to the WCF Service that it can then use to hydrate a domain object and act upon it.

I hope this helps!