ExtendedObjectDataSource samples

Product Information


A lot of people can use the CompatObjectDataSource or the ExtendedObjectDataSource as they are, but others need to tweak or change some behaviour to fit their needs. Fortunately you do not have to create a DataSourceControl control from scratch if you need to do some changes to the ExtendedObjectDataSource as it has been designed with extensibility in mind (and you can save yourself the time and money to type more than 11000 lines of source code).

The CompatObjectDataSource and the ExtendedObjectDataSource have been designed to be easily extended. The following class diagram shows how you can plug in custom caching and custom strategies to create your custom DataSourceControl:

Class diagram 1

There is a sample explaining how to create a custom cache. The behaviour of the controls when performing a Select, Insert, Update or Delete operation can be configured dynamically using a strategy pattern. Each strategy is built as four substrategies (one for each of the operations performed by the DataSourceControl) so if you need to create a new strategy that shares some similarities with any of the substrategies implemented you can use it and extend it easily (in fact, that is how the ExtendedObjectDataSource is implemented, changing how the Select operation is performed by the CompatObjectDataSource):

Class diagram 2

As helpful as the strategy pattern is to quickly build new strategies based on existing substrategies, in the source code there are a lot of helper methods that come handy when you want to create your own DataSourceControl that can save you a lot of time and headaches, as well as code for adding full design time support to your DataSourceControl.