Subject Re: [IBO] Need to make forms "DatasetAware"
Author Nando Dessena
Marco,

> Since I'm extensively using data modules as container for my queries
> and datasources, but often I need specific control inside the form of
> the dataset behaviour, wouldn't be necessary a "source" component to
> make the form DatasetEvents aware? A sort of TransactioSource that has
> the same IB_Query events and that are triggered by the events of the
> linked dataset? (so the form can react to AfterInsert, AfterPost,
> etc.).

I just can't see the point in separating your code into different units
if you then go and mix concerns back into the form unit. If you do this,
you'd better follow Jason's suggestion and put everything on the form.

My way of doing things is slightly different, BTW. I also make forms as
self-contained as possible, but each instance of a form usually includes
a private datamodule object, just for separation of concerns (and code).
If the form needs to be notified of anything that happens inside a
contained object, I define and hook an event. This does not depend on
the contained object being a data module or whatever.

Putting everything in a single unit can lead to confusion and code
duplication, but separating the code in smaller pieces and then tightly
couple those pieces to each other can be even worse, since you do the
hard work and don't get the benefits.

Ciao
--
____
_/\/ando