Subject | Re: [IBO] Data Module Inheritance |
---|---|
Author | paultugwell <pault@guardbase.co.uk> |
Post date | 2003-01-13T09:45:11Z |
--- In IBObjects@yahoogroups.com, "Brian K. Woods" <brian@e...> wrote:
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.
> > -----Original Message-----exe's
> > 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
> > all using a common set of basic queries to which the queriesspecific
> > to the particular exe would be added. I thought I'd be clever andThe
> > create a data module containing these queries and save it in the
> > object repository. The data modules in the individual exe's would
> > then be created by inheritence. This work except for one thing.
> > base datamodule contains a TIBODatabase with the DatabaseNameproblems
> > property set to SYS. When I create the inherited data module the
> > DatabaseName is shown as SYS_1. Connecting SYS_1 creates only one
> > connection to IB (as shown by IB_SQL) but SYS also shows as
> > 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 are
> with it asdoesn't like it
> far as connections, etc goes. However, the programmer in me
> since it's justthrowing red
> not clean design, as I figure the programmer in you must be
> flags, too (else you wouldn't ask...)datamodule
>
> My suggestion: why don't you replace the TIBODatabase in the base
> class with a TIBODatabase property, thatthe
> gets supplied in a virtual constructor or property when you create
> descendant instance? Thathidden
> gets rid of your duplicate database objects as well as avoids any
> problems that they might orInterseting idea, but this is really the answer in this case. As well
> might not cause. Base classes don't really need anything except the
> interface anyway, since you don't generally
> create an instance of a base class.
>
> HTH,
> Brian
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.