To this point, this article has discussed how the J2EE and .NET frameworks, in one form or another, address the needs of developers creating smart-client applications. However for the final obstacle, data synchronization, only one of the frameworks provides an instrument to emerge victorious: .NET.
The tax-return-processing application enables accountants to take their work home with them, but what exactly happens when a user uploads the processed version of a tax return? The server-side application will need to perform data synchronization somehow. That is, the server will be responsible for making sure a given tax return has not been revised by someone else during the time it was being processed by a given user. If it hasn't, the server also must make sure the tax return information in the database gets updated. Developers could always accomplish this task by writing the appropriate code and SQL statements, but .NET supplies them with a glorious alternative: the DataSet class.
A DataSet object provides an in-memory representation of data from one or more tables in a database. An application can use this object not only to read data, but also to insert and update rows. When the application is ready to synchronize the in-memory data with the database, the DataSet object will generate and run the appropriate SQL to perform all synchronization. This saves programmers all the time they would otherwise spend developing (and debugging) synchronization implementations. The following is an example of this synchronization from the tax-return-processing application:
|Synchronization from the Tax-return-processing Application|
J2EE, on the other hand, currently offers no equivalent feature. However, this does not stop Java developers from implementing data synchronization in smart-client applications time and time again. It merely means that they have to either obtain a component similar to DataSet from a third party or code data synchronization from scratch. Since software reuse saves thousands of dollars every day, the latter choice can become expensive.
So Which Framework Should I Use, .NET or J2EE?
Unfortunately, the decision between frameworks still has no clear-cut choice. J2EE has more to offer in terms of no-touch deployment, but only .NET provides pre-packaged synchronization logic and in-memory manipulation of DataSets. As with all applications, choosing the right technology depends heavily on your specific application's functional and technical requirements.