Subject | Re: [IBO] Data Module Inheritance |
---|---|
Author | paultugwell <pault@guardbase.co.uk> |
Post date | 2003-01-13T09:49:21Z |
--- In IBObjects@yahoogroups.com, "paultugwell <pault@g...>"
<pault@g...> wrote:
after you've clicked the send button!! My message should have read
Interseting idea, but this is not really the answer in this case. As
well as the datamodule itself being common to a number of programs,
the TIBODatabase objects and a number of queries will also be common.
My motivation in doing this was to enable me to reuse the queries in
different profgram.
<pault@g...> wrote:
> --- In IBObjects@yahoogroups.com, "Brian K. Woods" <brian@e...>wrote:
> > > -----Original Message-----and
> > > From: paultugwell <pault@g...> [mailto:pault@g...]
> > > Sent: Friday, January 10, 2003 5:17 AM
> > > To: IBObjects@yahoogroups.com
> > > Subject: [IBO] Data Module Inheritance
> > >
> > >
> > > I have just started a project where there will be a number of
> exe's
> > > all using a common set of basic queries to which the queries
> specific
> > > to the particular exe would be added. I thought I'd be clever
> > > create a data module containing these queries and save it in thewould
> > > object repository. The data modules in the individual exe's
> > > then be created by inheritence. This work except for one thing.one
> The
> > > base datamodule contains a TIBODatabase with the DatabaseName
> > > property set to SYS. When I create the inherited data module the
> > > DatabaseName is shown as SYS_1. Connecting SYS_1 creates only
> > > connection to IB (as shown by IB_SQL) but SYS also shows asare
> > > connected. However, connecting SYS does not connect SYS_1.
> > > Is this process valid and will it cause me any problems?
> >
> > I'm not one with the knowledge to accurately tell you if there
> problemscreate
> > with it as
> > far as connections, etc goes. However, the programmer in me
> doesn't like it
> > since it's just
> > not clean design, as I figure the programmer in you must be
> throwing red
> > flags, too (else you wouldn't ask...)
> >
> > My suggestion: why don't you replace the TIBODatabase in the base
> datamodule
> > class with a TIBODatabase property, that
> > gets supplied in a virtual constructor or property when you
> thethe
> > descendant instance? That
> > gets rid of your duplicate database objects as well as avoids any
> hidden
> > problems that they might or
> > might not cause. Base classes don't really need anything except
> > interface anyway, since you don't generallyIsn't it funny how you always notice the error in your typing just
> > create an instance of a base class.
> >
> > HTH,
> > Brian
>
after you've clicked the send button!! My message should have read
Interseting idea, but this is not really the answer in this case. As
well as the datamodule itself being common to a number of programs,
the TIBODatabase objects and a number of queries will also be common.
My motivation in doing this was to enable me to reuse the queries in
different profgram.