It seems that Microsoft has released the Smart Client Application Block. Happiness.
What’s important about this application block? Well, one of the attributes of a Smart Client is its ability to work offline. Having the ability to work in a disconnected state can take one of two approaches; A Data Centric Approach or a Service Oriented Approach.
A Data Centric Approach essentially identifies a client architecture that is quite coupled with the server. All data changes are made to a client side database and then merge replication is used to propagate the changes back to the server (based on what data the client has subscribed to). Changes made on the server also propagate back to the client using the same mechanism. With this approach you have a tightly coupled, two tier architecture that requires the client side component to have a local data store (MSDE or SQLCE).
A Service Oriented Approach (buzz buzz buzz word alert) forces all interactions between physical components through service requests – allowing for a more loosely coupled and well insulated architecture. This allows the client to interact with services not having to worry about making direct changes to local data. With a SOA approach, the client side data schema can be different than on the server and you will typically need to write business logic to perform conflict detection and resolution. To support offline use, infrastructure is required to store requests that are to be executed when the client reconnects to the network.
The reality is that we don’t live in a completely connected world, yet building applications that need to function offline isn’t completely a snap. This application block demonstrates a number of patterns that will put you on the right track if you are thinking about building a smart client solution from scratch.
This block provides a HUGE amount of plumbing – but I’m sure you can find ways to extend it or make it better – I’ll love to hear your ideas – thoughts and general feedback as I have a general passion for the smart client model.