13.07.2015 Views

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

a DiffGram. To make DiffGrams really usable, the availability of schema <strong>in</strong><strong>for</strong>mation isvital.A Save-and-Resume ApplicationAs a stateful data <strong>for</strong>mat, a DiffGram is particularly useful <strong>for</strong> build<strong>in</strong>g save-and-resumeapplications. In this context, a save-and-resume application is a desktop or Webapplication that can work both on l<strong>in</strong>e and off l<strong>in</strong>e. For such applications, the connectionto the rest of the back-end system is optional and is not guaranteed to be up all thetime. From the connectivity standpo<strong>in</strong>t, a save-and-resume application is <strong>in</strong>termittentand must be able to get its core data either remotely (<strong>for</strong> example, from the centralsystem) or locally (<strong>for</strong> example, from data persisted to files).In this section, we'll build a W<strong>in</strong>dows Forms application that connects to a database,downloads some data, and disconnects. From this po<strong>in</strong>t on, the application worksdisconnected, the data it needs is stored locally, and the application can be usedanywhere and shut down and resumed any number of times. All the changes made tothe local data are correctly tracked and reported as <strong>in</strong>sertions, deletions, and updates.At a later time, the application reconnects to the system and submits its changes.In this description, common words such as connection, back-end system, data,database, and updates are treated as blanket terms that each application canimplement as needed. For example, a simple query executed on a SQL Server table <strong>in</strong>the sample application can easily become a call to a middle-tier object. Similarly, asimple connection to SQL Server <strong>in</strong> the sample application could be viewed as a log<strong>in</strong><strong>in</strong> a distributed application.NoteWhile look<strong>in</strong>g at the sample application discussed here, keep <strong>in</strong>m<strong>in</strong>d that it is just a sample. Focus on the technologies <strong>in</strong>volved andtheir <strong>in</strong>teractions rather than on the implementation details. Theoverall context of the sample application, while representative of acommon type of application, is certa<strong>in</strong>ly not a real-world scenario!Sett<strong>in</strong>g Up the ApplicationThe key functions of a save-and-resume application can be summarized <strong>in</strong> threecategories. First, the application must be able to work disconnected, thus transparentlyus<strong>in</strong>g a local copy of the back-end database. Next, the application must allow you toreview, filter, and reject changes. F<strong>in</strong>ally, the application must allow you to reconnectand submit changes at any time. Figure 10-7 shows the key elements of thearchitecture.378

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!