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.