Re: Sharing binaries/code between client and server in a DDD environment
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
We're using DDD with .NET/WCF. We have a domain layer separate from our DTO layer, like you said. And while we have DTO versions of our entities, we also have DTO versions of our value objects and even enums In your example, we would have "OurSystem.Contract.GenderEnum" and "OurSystem.Domain.GenderEnum". We also have "adaptation extensions" classes in out application layer that are .NET extension methods to convert between our DTOs and domain values. This allows us to write code like myDto.FooValue = domain.FooValue.ToDto(). In that case, "ToDto" is an extension method defined in the application layer that takes in the domain value as the "this" parameter.