Hello,
One of my application requirements is that when the user logs in, if they are not conected through the VPN, I need to perform all data access through webservices and if they are logged in, use my business components directly. Does anyone have any good ideas for this or point me in the direction of any existing patterns
Thanks!

DataAccess Design Pattern
Ryan F
Hi Diesel,
If the business operations are similar in Webservice as well as the Business components. All that you have to do is have a common interface implemented by both of them. Have a Gateway class that checks whether the user has logged in or not. Accordingly return the webService or the Business classes using the factory pattern to the client. The client will never know whether he is requesting a web service or the business components.
Regards,
Ajeeth.
BuzzBar
MLyons10
To make it a little more formal, you should let both web service and the business object implement a single interface. Lets call the interface as IBusiness.
Have a common class that accepts the method calls (possibly) from the UI. Lets call the class as BusinessCallInterceptor.
Have a factory class that creates an instance of either webservice or business component based on wheather the user has logged in or not. The factory returns IBusiness.
The flow will be something like, UI calling the BusinessCallInterceptor, which in turn calls the factory to get IBusiness and then call required method on it.
You will have to have interfaces for each of your business components and the factory should have methods that return these interfaces.
bensterdev
1 . You are working on cross technology project
2 . You are working across public networks which do not allow anything more than HTTP over port 80.
As you all must be knowing, web serviecs come to our rescue in the above scenarios, but in all other cases, they are really realy taxing on performance (think about loads of serialized XML}
Martin Schmidt
One question is why bother with "using business components directyly" if the web-services approch is good enough why do you need to write and test another way to do the same thing
Anyway, if you do need to do this - you should seperate the interface of your business logic from the logic itself. then you can create one edge that exposes itself as webservices and another edge that exposes itself in what ever other way. benefits are that the logic can be tested once. you can add/change interfaces later etc.
Arnon