简体   繁体   中英

objects returned in wcf service response, what are they?

I am developing an MVC4 application that communicates to a set of WCF services to retrieve data. I generate service references from the endpoints using svcutil.

The service operations accept a request object and return a response object. Within these object are "entities". For example, a getproduct operation returns a getproductresponse object which has a property called Product which is of type "Product".

Question I have is, the "Product" object, an entity, poco or domain object? I want to create class library that contains all of such objects but not sure what it should be called.

For MVC layer, it's DTO. However, you should not guess if the service sends you the entity, poco, or domain object. These are nothing more than just data containers for you (as MVC layer author).

One more argument to treat/call them just as DTO is because service implementation may change in the future and you may end up having something else, but with the same structure on your side.

DTO means Data Transfer Object.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM