BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OOP & Visual Component & Object inspector

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
Maziar
Guest





PostPosted: Thu Jan 13, 2005 7:20 pm    Post subject: OOP & Visual Component & Object inspector Reply with quote



Hi

I have one question :

I try write FULL OOP program with Delphi I define one class base of my APP :

unit uMainDB
TMainDB = class(TDataModule)
private
//some code
public
IBD : TIBDatabase;
end;

unit uDataTable1
uses uA,uMainDB;
TIBT1 = class(TDataModule)
private
//some code
public
IBT1 : TIBDataset
end;

unit uA;
uses uMainDB;
TAPP = class(TDataModule)
private
//some code
public
MainDB : TMainDB;
//some other code;
end;

var
APP : TAPP;

I never define public var in uMainDB;

I no understand why in design time in object inspector for
IBT1(TIBDataset) can
not link database property in to APP.MainDB.IBD ? (in only
can in run time) ?




Back to top
Kyle A. Miller
Guest





PostPosted: Thu Jan 13, 2005 7:45 pm    Post subject: Re: OOP & Visual Component & Object inspector Reply with quote



Maziar wrote:
Quote:
I no understand why in design time in object inspector for
IBT1(TIBDataset) can
not link database property in to APP.MainDB.IBD ? (in only
can in run time) ?

Does App.MainDB exist at design time? It can't because you don't create
it till run-time. The form designer can't link to something that doesn't
exist yet.

You might try, though I haven't tested, to wrap TApp into a TComponent
and expose MainDB as a published property. Create TApp in the creation
of your TComponent.

Back to top
Maziar
Guest





PostPosted: Thu Jan 13, 2005 8:00 pm    Post subject: Re: OOP & Visual Component & Object inspector Reply with quote



can do me more comment
seem OOdesign have some conflict with visual relation ?
"Kyle A. Miller" <kyle@millerdevelopment##remove#.info> wrote

Quote:
Maziar wrote:
I no understand why in design time in object inspector for
IBT1(TIBDataset) can
not link database property in to APP.MainDB.IBD ? (in only
can in run time) ?

Does App.MainDB exist at design time? It can't because you don't create
it till run-time. The form designer can't link to something that doesn't
exist yet.

You might try, though I haven't tested, to wrap TApp into a TComponent
and expose MainDB as a published property. Create TApp in the creation
of your TComponent.



Back to top
Joanna Carter (TeamB)
Guest





PostPosted: Fri Jan 14, 2005 10:06 am    Post subject: Re: OOP & Visual Component & Object inspector Reply with quote

"Maziar" <mnavahan (AT) yahoo (DOT) com> a écrit dans le message de news:
[email]41e6ca06 (AT) newsgroups (DOT) borland.com[/email]...

Quote:
I try write FULL OOP program with Delphi I define one class base of my APP
:


Quote:
I no understand why in design time in object inspector for
IBT1(TIBDataset) can
not link database property in to APP.MainDB.IBD ? (in only
can in run time) ?

If you are trying to design a fully OO application then I don't see why you
are deriving from TDataModule just to include one component.

If components are not declared in the default visibility (published) then
they are certainly not visible in the Object Inspector.

Do you understand or do we need to explain further ?

Joanna

--
Joanna Carter (TeamB)

Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker



Back to top
Maziar
Guest





PostPosted: Fri Jan 14, 2005 1:59 pm    Post subject: Re: OOP & Visual Component & Object inspector Reply with quote

hi Joanna

i need link IBT1(TIBDataset) database property in to IBD(TIBDatabase)
in design time
if move the IBT1 or IBD to published section no problem resolved ...
how do visual realtion in this topic ?

"Joanna Carter (TeamB)" <joanna (AT) nospam (DOT) co.uk> wrote

Quote:
"Maziar" <mnavahan (AT) yahoo (DOT) com> a écrit dans le message de news:
[email]41e6ca06 (AT) newsgroups (DOT) borland.com[/email]...

I try write FULL OOP program with Delphi I define one class base of my
APP
:

I no understand why in design time in object inspector for
IBT1(TIBDataset) can
not link database property in to APP.MainDB.IBD ? (in only
can in run time) ?

If you are trying to design a fully OO application then I don't see why
you
are deriving from TDataModule just to include one component.

If components are not declared in the default visibility (published) then
they are certainly not visible in the Object Inspector.

Do you understand or do we need to explain further ?

Joanna

--
Joanna Carter (TeamB)

Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker





Back to top
Joanna Carter (TeamB)
Guest





PostPosted: Fri Jan 14, 2005 2:21 pm    Post subject: Re: OOP & Visual Component & Object inspector Reply with quote

"Maziar" <mnavahan (AT) yahoo (DOT) com> a écrit dans le message de news:
[email]41e7d034 (AT) newsgroups (DOT) borland.com[/email]...

Quote:
i need link IBT1(TIBDataset) database property in to IBD(TIBDatabase)
in design time
if move the IBT1 or IBD to published section no problem resolved ...
how do visual realtion in this topic ?

I have now asked you twice; why are you deriving from TDataModule ?

Answer this and then we can progress further.

Joanna

--
Joanna Carter (TeamB)

Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker



Back to top
Kyle A. Miller
Guest





PostPosted: Fri Jan 14, 2005 3:51 pm    Post subject: Re: OOP & Visual Component & Object inspector Reply with quote

Maziar wrote:
Quote:
can do me more comment
seem OOdesign have some conflict with visual relation ?

Or the OO design is flawed. I don't understand what you are trying to
achieve with that design. Why do you need two database components? If
you have one datamodule that is the "main" datamodule for the
application, then why have another called TAPP?

Back to top
Maziar
Guest





PostPosted: Fri Jan 14, 2005 4:10 pm    Post subject: Re: OOP & Visual Component & Object inspector Reply with quote

1. what is problem if use base class Tdatamodule ?
2. because i need put some VCL in it ! (for example TIBDatabase)
"Joanna Carter (TeamB)" <joanna (AT) nospam (DOT) co.uk> wrote

Quote:
"Maziar" <mnavahan (AT) yahoo (DOT) com> a écrit dans le message de news:
[email]41e7d034 (AT) newsgroups (DOT) borland.com[/email]...

i need link IBT1(TIBDataset) database property in to IBD(TIBDatabase)
in design time
if move the IBT1 or IBD to published section no problem resolved ...
how do visual realtion in this topic ?

I have now asked you twice; why are you deriving from TDataModule ?

Answer this and then we can progress further.

Joanna

--
Joanna Carter (TeamB)

Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker





Back to top
Joanna Carter (TeamB)
Guest





PostPosted: Fri Jan 14, 2005 4:40 pm    Post subject: Re: OOP & Visual Component & Object inspector Reply with quote

"Maziar" <mnavahan (AT) yahoo (DOT) com> a écrit dans le message de news:
[email]41e7ef05 (AT) newsgroups (DOT) borland.com[/email]...

Quote:
1. what is problem if use base class Tdatamodule ?

Are you using the IDE wizard to create the data modules or are you writing
them yourself in a new unit ? If you are writing it yourself, then you
cannot expect the object inspector to work unless there is also a .dfm file
which the IDE wizard automatically creates.

Quote:
2. because i need put some VCL in it ! (for example TIBDatabase)

Then why not use the visual designer and add as many of your components to
one module as you need for one form, etc.

Joanna

--
Joanna Carter (TeamB)

Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
Quote:




Back to top
Maziar
Guest





PostPosted: Fri Jan 14, 2005 6:39 pm    Post subject: Re: OOP & Visual Component & Object inspector Reply with quote

Quote:
Then why not use the visual designer and add as many of your components to
one module as you need for one form, etc.

i do it but my qustion is clear :
how crate link between my database and dataset usign designer
please see my last post ...



Back to top
Bob Dawson
Guest





PostPosted: Sat Jan 15, 2005 2:22 am    Post subject: Re: OOP & Visual Component & Object inspector Reply with quote

"Maziar" wrote

Quote:
how crate link between my database and dataset usign designer
please see my last post ...

Design time linking of components isn't really an oodesign topic. I'd try an
appropriate database or component forum.

bobD



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.