mardi 17 novembre 2015

How to design DTO for this scenario?

I have the following situation:

User Object

  • Half of the data for the structure is stored in the DB(owned by me).
  • Other half of the data is coming from Third Party(via web api).
  • Another important point is that I want to use ExpressMapper(or any other good suggestions) for mapping Entity/Service objects to DTOs.

I want to use DTO pattern for transferring the user information between different layers.

Questions:

  1. Should I make a large DTO containing all the properties of both of the Service Object and the DB Object?

  2. Should I create Third Party Data Objects as properties of the DTO. I mean hide the Service Data objects behind an interface and make that interface as a property of the DTO.

  3. Do I need to make interfaces for DTO in case 1 or 2?

Aucun commentaire:

Enregistrer un commentaire