🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
2 messages
2 total messages Started by Stewart Clark Thu, 15 Jul 1999 00:00
MTS and BDE
#1651
Author: Stewart Clark
Date: Thu, 15 Jul 1999 00:00
21 lines
1266 bytes
I posted this in ActiveX and got no response, maybe it should be in
MultiTier...........

I am trying to create an MTS object using BDE.

1st Problem: What to Create?

Do I create an MTS Object for my "Business Logic" and an MTS Data Module for
the DB in the same DLL?

OR do I Create only an :MTS Data Object and add a number of Methods to the
object for my "Business Logic"?

2nd Problem:  When I create an MTS Data Object (using the wizard), I notice
that the wizard does not create any code to instantiate the MTS Data Object.
Where should I do that?  Do I do it in the ::Activate method (that the
Wizard creates) or should I do it in the constructor for the ....Impl class?
Or does it just happen???

Thanks in advance
Stewart Clark
Re: MTS and BDE
#1680
Author: Harold Howe [TeamB]
Date: Mon, 26 Jul 1999 00:00
50 lines
2419 bytes
Stewart Clark wrote:

> 1st Problem: What to Create?
> 
> Do I create an MTS Object for my "Business Logic" and an MTS Data Module for
> the DB in the same DLL?

I'm not an MTS expert, but I play one on TV. If your MTS object is for a
database object, then I believe that you run the MTS data module wizard.
This will require that you have an ActiveX library open. If you don't,
then the wizard will create one for you. The MTS object also adds
something to an ActiveX library, but you don't end up with a datamodule
in your library.


> OR do I Create only an :MTS Data Object and add a number of Methods to the
> object for my "Business Logic"?

You can do that, but you lose the visual design features for tables
queries and such.

> 
> 2nd Problem:  When I create an MTS Data Object (using the wizard), I notice
> that the wizard does not create any code to instantiate the MTS Data Object.
> Where should I do that? 

The code that instantiates the MTS object goes in the client. The code
that queries your tables goes in the methods of your MTS object.
Activate and Deactive are there for you to use. They behave like
constructors and destructors for your MTS object. 

You can query the database in Activate if you want to. 

> or should I do it in the constructor for the ....Impl class?

According to an MTS discussion that Robert West gave at the conference,
you should avoid using the constructor of an MTS object, because you are
not really sure when the object will be destroyed and created, or when
it will be pooled (I might be distorting his explanation). Anyway, use
Activate and Deactivate. 


> Or does it just happen???

From the client side, creating an MTS object is not really any different
than creating a non-mts object. On the server side, things are much
different.

Harold Howe [TeamB]
http://www.bcbdev.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads