locked
how to show wcf proxy's datasets to the ui layer in a three layer app RRS feed

  • Question

  • Hello from Spain,

    I have a client-server app. The client is made in three layers (service agent, bll, ui). Client connects to the server through a web service. The the web service's proxy is in the last layer, service agent, so we can see the datasets that come in the proxy from the bll, but i want them in the ui too. I haven't found any pattern or something to acomplish that and i can not find a solution without breaking the encapsulation of the bll.

    Any suggestion?

    Thanks in regards

    • Moved by Max Wang_1983 Tuesday, April 26, 2011 6:29 PM forum consolidation (From:Architecture, Tools, and Process for ISVs)
    Friday, July 28, 2006 3:54 PM

Answers

  • Your best bet is to look at the sample application  PetShop (link below).

     Basically where you have your datasets they have classes that they call the Model which is independent of all layers (just its own project and dll) and so you can reference it from any layer in the solution. This is pretty standard pratcice for n-tier applications.  Note that to get a Model project using datasets you might want to consider using typed datasets.

     

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bdasamppet4.asp

     

    Friday, August 4, 2006 2:30 PM
  • For these scenarios, I typically use a data transfer object (see Martin Fowlers example http://www.martinfowler.com/eaaCatalog/dataTransferObject.html).  The DTO's are just classes with properties and no methods associated with them.  They can be used by any layer in the application architecture, and thus get placed into a common assembly.  I use these DTOs in the service interface, allowing me to change the domain model without breaking the service interface.
    Thursday, August 17, 2006 4:00 PM

All replies

  • Your best bet is to look at the sample application  PetShop (link below).

     Basically where you have your datasets they have classes that they call the Model which is independent of all layers (just its own project and dll) and so you can reference it from any layer in the solution. This is pretty standard pratcice for n-tier applications.  Note that to get a Model project using datasets you might want to consider using typed datasets.

     

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bdasamppet4.asp

     

    Friday, August 4, 2006 2:30 PM
  • For these scenarios, I typically use a data transfer object (see Martin Fowlers example http://www.martinfowler.com/eaaCatalog/dataTransferObject.html).  The DTO's are just classes with properties and no methods associated with them.  They can be used by any layer in the application architecture, and thus get placed into a common assembly.  I use these DTOs in the service interface, allowing me to change the domain model without breaking the service interface.
    Thursday, August 17, 2006 4:00 PM