switch between local and remote (web) Business Logic

K

kies98

Hi Everyone,

i need some ideas for the following problem:

I am developing a three tier architecture. The client should be
implemented in WPF to be able to easily port the application to a web
application later on.

The Business and Data Tier should be easily portable from local
computer to a remote one somewhere on the web. So the only possible
Link between Client and Business Logic would be a Webservice, wouldn't
it?? In the local scenario I don't want to use a Webservice but only
the usual construct of interfaces to connect the layers.

What would be the best approach here ? Maybe you guys could push me
into some direction ??

I thought of implementing a second Assembly on the client which on one
side the client connects to, to send and receive it's data and which
can on the other side be configured easily to use either local
connection or the remote Webservice connection.

Thanks,
Oliver
 
D

David Sandor

Oliver,

In this situation you should build your application to use an 'adapter'
approach.

You are going to need to build an assembly that hits the web service for the
remote deployment and an assembly for the local deployment. Create an
interface that is shared between your app, the remote adapter assembly, and
the local adapter assembly. Your app should load the correct assembly
(local or remote adapter assembly) based on the .config file and make all
your calls to the loaded assembly by interface. These adapter assemblies
expose the business logic to the application via the interface.

This will open up your app to work optimally in both scenarios.

-David Sandor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top