Who let that smart client into my database?
Some of the comments about my Lazy Load post included discussion about how to handle Lazy Load scenarios in this cases. The answer is simple, I don't. I don't handle this scenario because I don't like the idea of a client application going directly against my database. This puts too much responsability at the client end, and leaving the server as a dumb data container. This also means that users can now connect to the database, which I really don't like.
My default architecture for a smart client application is a client application that talks to a set of web services, where usually there is a one service per form, or per functionality. In those cases, I don't worry about the usual SOA stuff, those are WS dedicated to the app. The application can make calls to the WS, and those make it explicit that a boundary is being crossed.
Comments
Good topic. This has been something I've had to do on my last couple of projects.
What is your reasoning for not liking direct access between an application and the database? What do you do where performance of web services is unacceptable?
Can you bring a use case for this?
I can't even imagine a case that direct DB access would be preferable to WS from performance point of view.
I don't like it because it means that my server side API is ODBC, not the friendliest to work with
@Shane:
The client should anyway send a request through the network, and the server should respond. The time-consuming part of the thing is in the network transport phase, no matter what protocol you are using.
You could possibly make it faster by doing a better serialization, which most of the time means that you lose the crappy SOAP envelope, and actually the whole XML thing altogether, and use an efficient schema for the messages you send back and forth.
@Shane,
What ken said :-)
what about apps with a local or even in-memory database, you obviously won't want to have a webservice in between :)
That is something else all together, of course, which doesn't have the same set of constraints as server/client apps
Comment preview