How to create the Middle tier 
Author Message
 How to create the Middle tier

You've probably seen my previous posts about whether to use Bound controls
(seem to limit to 2 tier), or to use classes (or another method) to create
an n-tier app....

The concensus seemed to be to create n-tier app, and avoid bound
controls.....

How do I create the middle tier?? As classes within the main app, as ActiveX
exe or ActiveX DLL or what??

Can anyone give me some guidance?? if possible, sample code would be
nice......

Thanks agian folks



Thu, 10 Oct 2002 03:00:00 GMT  
 How to create the Middle tier

Quote:
> You've probably seen my previous posts about whether to use Bound controls
> (seem to limit to 2 tier), or to use classes (or another method) to create
> an n-tier app....

> The concensus seemed to be to create n-tier app, and avoid bound
> controls.....

> How do I create the middle tier?? As classes within the main app, as
ActiveX
> exe or ActiveX DLL or what??

> Can anyone give me some guidance?? if possible, sample code would be
> nice......

That depends on the planned physical distribution so there is no one answer.
You can use a DLL that is deployed with the application on the client or is
run under MTS on a server.  You can use an ActiveX EXE, again either on the
client or as a stand-alone app on a server system.  If you deploy to the
client then when you need to update you have to redistribute to all clients
but you get better performance in most cases.  If you deploy to a server you
can update it easily but performance may be an issue.

When you design your middle tier try to do it so that it is stateless --
don't set & retrieve individual properties but rather call methods that
process your requests and return as much data as possible in one shot (via
an array, a disconnected recordset, XML, whatever).  That way you minimize
traffic between the client and the server components so performance hits are
minimized and you are set up for implementation under MTS if you decide to
go that route.

This topic has scores of books written about it and a discussion of all the
details would take volumes.  My best advice is to get a couple ofbooks on
the subject and do some heavy reading.



Thu, 10 Oct 2002 03:00:00 GMT  
 How to create the Middle tier
Thanks for your reply......

A DLL would make more sense than using an EXE?? I do not plan for the middle
tear to run standalone.....
Is there any way of writing a DLL other than as ActiveX??? Which is the best
way to do it??

Also, assuming that I use a DLL (of some kind), sitting client-side, how do
I get all the recordsets from the DLL to use one connection??
Do I open the connection each time, in the DLL??
Do I open the connection once on the app, and somehow get the DLL to use
it?? How??
Can I get the DLL to open it, and keep it open, until the app ends, then
call the DLL to close it....??

Can anyone help further??

Thanks again


Quote:


> > You've probably seen my previous posts about whether to use Bound
controls
> > (seem to limit to 2 tier), or to use classes (or another method) to
create
> > an n-tier app....

> > The concensus seemed to be to create n-tier app, and avoid bound
> > controls.....

> > How do I create the middle tier?? As classes within the main app, as
> ActiveX
> > exe or ActiveX DLL or what??

> > Can anyone give me some guidance?? if possible, sample code would be
> > nice......

> That depends on the planned physical distribution so there is no one
answer.
> You can use a DLL that is deployed with the application on the client or
is
> run under MTS on a server.  You can use an ActiveX EXE, again either on
the
> client or as a stand-alone app on a server system.  If you deploy to the
> client then when you need to update you have to redistribute to all
clients
> but you get better performance in most cases.  If you deploy to a server
you
> can update it easily but performance may be an issue.

> When you design your middle tier try to do it so that it is stateless --
> don't set & retrieve individual properties but rather call methods that
> process your requests and return as much data as possible in one shot (via
> an array, a disconnected recordset, XML, whatever).  That way you minimize
> traffic between the client and the server components so performance hits
are
> minimized and you are set up for implementation under MTS if you decide to
> go that route.

> This topic has scores of books written about it and a discussion of all
the
> details would take volumes.  My best advice is to get a couple ofbooks on
> the subject and do some heavy reading.



Thu, 10 Oct 2002 03:00:00 GMT  
 How to create the Middle tier


Quote:
> Thanks for your reply......

> A DLL would make more sense than using an EXE?? I do not plan for the
middle
> tear to run standalone.....

If the logical middle tier is going to run on the client system then a DLL
is better for performance -- it runs in the same memory space as your UI and
that is the least overhead.  You should still design as if the middle tier
runs on another system since that gives you the most flexibility to change
your mind later and still get decent performance.  The nice thing about VB
is that switching ActiveX DLL to ActiveX DLL is generally trivial.

Quote:
> Is there any way of writing a DLL other than as ActiveX??? Which is the
best
> way to do it??

VB only creates ActiveX DLLs so unless you are going to write C++ or other
language components you are limited to ActiveX (COM).

Quote:
> Also, assuming that I use a DLL (of some kind), sitting client-side, how
do
> I get all the recordsets from the DLL to use one connection??

Your DLL would have one connection object instantiated and would use it
whenever it needs it.

Quote:
> Do I open the connection each time, in the DLL??

Opening the connection each time adds overhead but improves scalability.  If
you only retain the connection when you are actually using it you will get a
lot more users supported and can take advantage of connection pooling when
you grow.

Quote:
> Do I open the connection once on the app, and somehow get the DLL to use
> it?? How??

If by the 'app' you mean the UI layer then no -- the UI should make requests
of the middle tier and the middle tier should conenct to the database.  The
UI doesn't need to know anything about the database.

Quote:
> Can I get the DLL to open it, and keep it open, until the app ends, then
> call the DLL to close it....??

One option is to establish the connection when the first object is created
from the classes in your DLL.  When the last object terminates you close the
connection -- again, the UI should not be telling the middle tier when to
open or close the connection.  Note that holding the connection open may
improve performance but cuts into the scalability.

Quote:
> Can anyone help further??

> Thanks again

I'm sure others can help -- this is a HUGE topic


Thu, 10 Oct 2002 03:00:00 GMT  
 How to create the Middle tier
You're stressing to much... First you need to look at what your application
is doing, take the time to do some UML up for it.

Usually when I'm creating a DLL I have one class within dedicated to
accessing data.  For example

Class_Report -> Class_DataAccess

So Class_Report has a property link (Get/Set) to Class_DataAccess, which in
turn would initialize the database(s) that you intend to use.  I usually use
GET/SET properties for each of the databases too, this way they are
initiated on demand.

This all depends on what your application has to do, and how it's going to
be deployed.

To answer your other question though... To compile a DLL just use classes
and modules only, no forms, and tell it to compile in DLL format.  Then it's
just a matter of distributing that DLL to each of the clients, or you could
have it register on a shared drive (much handier for updating).

Hope that answered some of your question... I'm told I'm a horrible teacher

Dave Kocher
Systems Analyst
MacLean Engineering and Marketing


Quote:
> Thanks for your reply......

> A DLL would make more sense than using an EXE?? I do not plan for the
middle
> tear to run standalone.....
> Is there any way of writing a DLL other than as ActiveX??? Which is the
best
> way to do it??

> Also, assuming that I use a DLL (of some kind), sitting client-side, how
do
> I get all the recordsets from the DLL to use one connection??
> Do I open the connection each time, in the DLL??
> Do I open the connection once on the app, and somehow get the DLL to use
> it?? How??
> Can I get the DLL to open it, and keep it open, until the app ends, then
> call the DLL to close it....??

> Can anyone help further??

> Thanks again





> > > You've probably seen my previous posts about whether to use Bound
> controls
> > > (seem to limit to 2 tier), or to use classes (or another method) to
> create
> > > an n-tier app....

> > > The concensus seemed to be to create n-tier app, and avoid bound
> > > controls.....

> > > How do I create the middle tier?? As classes within the main app, as
> > ActiveX
> > > exe or ActiveX DLL or what??

> > > Can anyone give me some guidance?? if possible, sample code would be
> > > nice......

> > That depends on the planned physical distribution so there is no one
> answer.
> > You can use a DLL that is deployed with the application on the client or
> is
> > run under MTS on a server.  You can use an ActiveX EXE, again either on
> the
> > client or as a stand-alone app on a server system.  If you deploy to the
> > client then when you need to update you have to redistribute to all
> clients
> > but you get better performance in most cases.  If you deploy to a server
> you
> > can update it easily but performance may be an issue.

> > When you design your middle tier try to do it so that it is stateless --
> > don't set & retrieve individual properties but rather call methods that
> > process your requests and return as much data as possible in one shot
(via
> > an array, a disconnected recordset, XML, whatever).  That way you
minimize
> > traffic between the client and the server components so performance hits
> are
> > minimized and you are set up for implementation under MTS if you decide
to
> > go that route.

> > This topic has scores of books written about it and a discussion of all
> the
> > details would take volumes.  My best advice is to get a couple ofbooks
on
> > the subject and do some heavy reading.



Thu, 10 Oct 2002 03:00:00 GMT  
 How to create the Middle tier
I suggest you get and read one or more books on the subject.  This is a complex subject and you won't be able to do a good job
without some background information.

For example:
Programming Distributed Applications with COM and VB6 - Tim Pattison
Professional Visual Basic 6 MTS Programming - Mathew Bortniker and James Conard
Visual Basic 6 Business Objects : R Lhotka, Wrox Press.
Building N-Tier Applications with COM and Visual Basic 6.0, Ash Rofail, Tony Martin
Dan Appleman's Developing COM/ActiveX Components with Visual Basic 6.0: A Guide to the Perplexed
Advanced Microsoft? Visual Basic? 6.0, 2nd Edition The Mandelbrot Set International, Ltd

See also MSDN (http://msdn.microsoft.com/library/default.asp), particularly:

Platform SDK: Component Services: Designing COM+ Applications:
http://msdn.microsoft.com/library/psdk/cossdk/pgdistributed_design_03...

Visual Studio: Using Visual Studio: Developing for the Enterprise
http://msdn.microsoft.com/library/devprods/vs6/vstudio/vsentpro/veovr...

--
Happiness is understanding how things work!

It is futile to know the correct answer to the wrong question!


Quote:

> Thanks for your reply......

> A DLL would make more sense than using an EXE?? I do not plan for the middle
> tear to run standalone.....
> Is there any way of writing a DLL other than as ActiveX??? Which is the best
> way to do it??

> Also, assuming that I use a DLL (of some kind), sitting client-side, how do
> I get all the recordsets from the DLL to use one connection??
> Do I open the connection each time, in the DLL??
> Do I open the connection once on the app, and somehow get the DLL to use
> it?? How??
> Can I get the DLL to open it, and keep it open, until the app ends, then
> call the DLL to close it....??

> Can anyone help further??

> Thanks again





> > > You've probably seen my previous posts about whether to use Bound
> controls
> > > (seem to limit to 2 tier), or to use classes (or another method) to
> create
> > > an n-tier app....

> > > The concensus seemed to be to create n-tier app, and avoid bound
> > > controls.....

> > > How do I create the middle tier?? As classes within the main app, as
> > ActiveX
> > > exe or ActiveX DLL or what??

> > > Can anyone give me some guidance?? if possible, sample code would be
> > > nice......

> > That depends on the planned physical distribution so there is no one
> answer.
> > You can use a DLL that is deployed with the application on the client or
> is
> > run under MTS on a server.  You can use an ActiveX EXE, again either on
> the
> > client or as a stand-alone app on a server system.  If you deploy to the
> > client then when you need to update you have to redistribute to all
> clients
> > but you get better performance in most cases.  If you deploy to a server
> you
> > can update it easily but performance may be an issue.

> > When you design your middle tier try to do it so that it is stateless --
> > don't set & retrieve individual properties but rather call methods that
> > process your requests and return as much data as possible in one shot (via
> > an array, a disconnected recordset, XML, whatever).  That way you minimize
> > traffic between the client and the server components so performance hits
> are
> > minimized and you are set up for implementation under MTS if you decide to
> > go that route.

> > This topic has scores of books written about it and a discussion of all
> the
> > details would take volumes.  My best advice is to get a couple ofbooks on
> > the subject and do some heavy reading.



Fri, 03 Jan 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How to create the Middle tier

2. How to create the Middle tier

3. 'COM-Gen 2000' - VB Add-In creates your middle tier for you in seconds!

4. 'COM-Gen 2000' - VB Add-In creates your middle tier for you in seconds!

5. middle-tier component

6. Middle Tier DB Classes

7. Displaying middle-tier documents at client workstation

8. Java middle tier with VB presentation

9. Middle tier development - Client Server Systems - Balto. MD

10. Developing a Middle Tier Server

11. Open middle tier data set

12. Middle tier

 

 
Powered by phpBB® Forum Software