What was (or would be) the reasoning behind creating TDataSource as an intermediary between data bound components and the actual underlying TDataSets, rather than having the components just connect directly to the TDataSets themselves?
This may seem like kind of a stupid question, but I am working on a broad set of "data viewer" components, which link to a common "data connector" component, etc; and in designing this set of components, I find myself referencing the structure of the classic Delphi "TDataSet -> TDataSource -> Data-bound-component" setup for guidance. In my component set, however, I keep wanting to essentially merge the functionality of the "TDataSource" and "TDataSet" equivalents into a single class. It got me wondering what the reasoning was behind separating them in the first place.
It is all about decoupling and indirection.
And with TDataSource there are two kinds of them:
Since many components can point to the same DataSource, you can quickly switch which underlying TDataSet they use by just flipping one TDataSource.DataSet property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With