none
Swapping between Distributed and Non-Distributed architecture RRS feed

  • Question

  • Hello

    We are the process of architecting a distributed application which uses ASP.NET and WCF.  While we clearly understand the benefits of distributed architecture, we want to allow easy swapping of WCF with Direct Memory Access (DMA).

    Our architecture consists of the presentation tier, the business tier, and the data tier (There are integration layers between the tiers.). The presentation tier uses the MVC design pattern. The business tier consists of our business objects. There are two integration layers - the WCF services and the data access layer.  The client facade and proxies are part of the WCF services integration layer. The data access objects are part of the data access layer. The controller in the presentation tier accesses the client facade which in turn access the auto generated WCF proxy. Please see below:

    ASP.NET===Controller===Façade===WCF Proxy----out of process call-----WCF Service Impl===BO===DAL

    I'm looking for your recommendation to make the architectural changes to allow easy swapping of WCF to use DMA. Just by doing some configuration changes I want to architecture as below:

    ASP.NET=====Controller =====Façade===== WCF Service Impl====BO====DAL

    In the above scenario, the client facade should simply call the service implementation class directly instead of accessing via proxy.

    I’m thinking of enforcing the façade to implement the same interface as Service interface and let controller to load the appropriate façade during run time based on the configuration. In this case, I would have two facades – one will make direct call to WCF service implementation and another will make use of the proxy. If you have any better ideas or potential issues with the above approach please let me know. Appreciate it.

    Tuesday, April 13, 2010 9:03 PM

Answers

  • Thanks Gags! In my proposal, the façade would act as a "façade" between the WCF services and the presentation tier's presentation logic. The controller would invoke the relevant method on the façade which will be propagated down the stack to the WCF service proxy. The façade hides the complexity of the WCF service call and allows for easy swapping of the façade to someother implementation - in this case, it will directly invoke the service implementation class to avoid the process boundary calls.

     

    • Marked as answer by arasheed Wednesday, April 14, 2010 12:22 PM
    Wednesday, April 14, 2010 12:20 PM

All replies

  • Hi,

    My take is that it would be better to shift  the decession of whom to use (service or service component) to either facade or WCF proxy , Controller are not just made for this by definition. Also it would be influenced by your deployment scenario, the above suggestion assumes that the ASP.NET, controller , facade and WCF PRoxies are in the same tier.

    Thanks

    Wednesday, April 14, 2010 10:04 AM
  • Thanks Gags! In my proposal, the façade would act as a "façade" between the WCF services and the presentation tier's presentation logic. The controller would invoke the relevant method on the façade which will be propagated down the stack to the WCF service proxy. The façade hides the complexity of the WCF service call and allows for easy swapping of the façade to someother implementation - in this case, it will directly invoke the service implementation class to avoid the process boundary calls.

     

    • Marked as answer by arasheed Wednesday, April 14, 2010 12:22 PM
    Wednesday, April 14, 2010 12:20 PM
  • Also try out the unity application block, which address exactly the same problem

    Thursday, April 15, 2010 7:17 AM
  • I will take a look. Thank you very much!!
    Thursday, April 15, 2010 4:00 PM