开发者

wcf wrapper around ddd project

I have two questions - :

1) I have to provide wcf wrapper around my ddd project. So , do the below design is correct ?

Mvc -> 开发者_如何学CServiceLayer(Wcf) -> app -> domain -> infra

Or App service will act as wcf service.

2) I know that I have to expose dto's in service layer. So, what ever service method's i expose in domain services and app services, do i have to create the same name method service in service layer too and call domain service and app service from service layer.


It's always hard answer this kind of question since it really depends by your needs and requirements.

For my point of view there is not "a best solution" but just a good solution that fit with your requirement.

Anyway in general what you are doing is correct but you have to make sure it fit with your needs: sometime we are obsessed with following the best practice the we risk to add too many layer to do something that could be done by 2 :-)

The only thing I can say is that you can't expose DTO as it is just a way to transfer objects (from a very high point of view it could be compared to a protocol) but it doesn’t say anything about what object are you exposing. You could create POCO objects instead and just expose them but in this case you will need an "Assembler" layer that will be used from the service layer to create the POCO objects against your "domain model". Both the assembler and the MVC layer as to know the POCO objects.

I hope it makes sense

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜