Abstracting the transport

Posts   
 
    
Dhominator avatar
Dhominator
User
Posts: 16
Joined: 28-Dec-2004
# Posted on: 13-Oct-2006 20:22:31   

The adapter uses remoting and you can use the generated objects with a web service. How do you abstract the transport in the application?

Conceptually, it seems like one would instantiate the adapter for a given transport. So, whether your using remoting or web services or whatever... the client code always uses the adapter.

Does this concept exist? If not, how should I approach abstracting the transport? Anyone played around with generating the webservice code via templates?

Best, /jhd

Chester
Support Team
Posts: 223
Joined: 15-Jul-2005
# Posted on: 14-Oct-2006 23:06:57   

Dhominator wrote:

The adapter uses remoting and you can use the generated objects with a web service. How do you abstract the transport in the application?

What do you mean by "the adapter uses remoting"?

Dhominator wrote:

Conceptually, it seems like one would instantiate the adapter for a given transport. So, whether your using remoting or web services or whatever... the client code always uses the adapter.

So you're trying to abstract the data transport mechanism to be whatever you want it to be, right? I've never seen this done, but it's an interesting idea. At some point though you have to actually connect to the database and do the real work of executing SQL, so I'm not sure what you get by abstracted the transport of data from, say, the UI layer, to the business layer, if you still then have to connect to the database and do the guts of the work.

mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 15-Oct-2006 13:02:25   

WCF aka Indigo provides something similar to abstract transport mechanism.

Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 18-Oct-2006 13:10:16   

Dhominator wrote:

The adapter uses remoting and you can use the generated objects with a web service. How do you abstract the transport in the application?

Conceptually, it seems like one would instantiate the adapter for a given transport. So, whether your using remoting or web services or whatever... the client code always uses the adapter.

Does this concept exist? If not, how should I approach abstracting the transport? Anyone played around with generating the webservice code via templates?

Best, /jhd

Hi,

I do not understand exactly what you want; but I will talk about what I understand you want:

Maybe you want to abstract the access to the BL from the UI layer, in that case you need to create a interface for each business object to want to access, this interface would contains the fuctions and subs that you would need to access from the UI. This interface would be implemented by its respective business object. You create a business factory that would return a object that implement the business's interface of the business object that you request from the business factory. The business factory know what kind of transport (remoting, webservice, any other in the future) to create based an entry in the configuration file (that is if the application would be using remoting or webservice, etc). In the case of remoting the business factory can return the remote object directly, because the remote object can implements the interface directly; in the case of webservice (as far as I know webservice can not implement interface) you would need a local object that implement the interface (return this object from the business factory to the UI layer) and this local object would call the webservice and return to the UI layer the object that it received from the webservice.