Click to See Complete Forum and Search --> : Three Tier in VB a myth?


Tomaz Stih
May 28th, 1999, 10:57 AM
Is three tier in VB a reality?

Most programmers I've seen use data controls and data bound controls to connect to DBMS. Does anyone actually writes class objects for business logic and then uses dumb controls at the presentation level to present information stored inside business logic object?

Anyone dividing program to three levels or all of you simply putting controls to forms and connecting them(?)

Sincerely,
Tomaz

---------------------------------------------
Tomaz Stih, B.Sc.CS tomaz@nameco.com
Ob sotoccju 10 Nameco Group
SI-1000 Ljubljana http://www.nameco.com
Europe

Gary Grant
May 28th, 1999, 12:33 PM
I don't know about anybody else but I have only once used bound controls. I suppose that it would be
OK if you only wanted to browse data but you loose almost all control when entering data into a bound control.

Crazy D
May 28th, 1999, 03:35 PM
Hi
I've used both a class to access the db as drop all code in a form. In the latter, i used usercontrols which did the validation things so in the form I didn't have to do more then add/modify the data. With the class, I used just the basic controls and let the class validate. I like the way with usercontrols more (since I like them :-) but after all there wasn't much difference for me, it's both easy. Although I can imagine that with some projects it's easier to use classes for the connection and validation.
Crazy D :-)

Huynh Quang Cuong
May 30th, 1999, 01:07 AM
Hello,
In three tier app, we can use Datasource class instead of bound control.
It is very good class for three tier App!!

Bye.
H.Q. Cuong
MCP

Ravi Kiran
May 30th, 1999, 11:44 PM
HI,

My style is: I usually design all my DB access in a seperate class - right from loading reference to "MS DAO 3.5 Object Library", defining a class member for database, recordset etc. It does have a little bit "more" of coding work, but it gives the liverage. Data valiation is usually done by a
member fn.
My semi-scientific progs doesn't have "Business Logic", so they remain mostly 2-tier. I guess the 3rd layer could be added if required.

so i have programes VB database apps, where i haven't even put a data control on the form!!. - May be i am reinventing the wheel:-)

Ravi Kiran

Tomaz Stih
May 31st, 1999, 08:39 AM
Hear, hear.

Do you know any good book or other source on the topic. I think that VB with it's easy COM interface could provide good common ground for a small team of developers. Business logic could be modelled using UML and then presentation level prototyped and the work effectively divided.

The one argument where bound controls perform better is browsing. But I did a test using collection object and list view to browse through the database and the code was not such an overhead. There would be a problems with displaying several 1000 records but my philosophy is - if you display more then 100 records at one time to the user you blew it anyway - change your usability heuristics.

I am very glad to hear that someone else is dividing database access to separate class. I thought the idea was weird.

Sincerely,
Tommy

---------------------------------------------
Tomaz Stih, B.Sc.CS tomaz@nameco.com
Ob sotoccju 10 Nameco Group
SI-1000 Ljubljana http://www.nameco.com
Europe

Tomaz Stih
May 31st, 1999, 08:47 AM
The real power of objects is when you divide work among more people. Also when you have a complex system where there are a lot of different events going around (for example data entry triggers some complex recalculation and so on...). Then dividing business logic (domain objects) and user interface gives your users the possibility of using the same user interface software on the first and the 100th version of domain level objects.
I guess with good planning you can have them both. Use bound controls to display data and also use report generators... directly. And use classes for data entry and for modelling other business processes.


---------------------------------------------
Tomaz Stih, B.Sc.CS tomaz@nameco.com
Ob sotoccju 10 Nameco Group
SI-1000 Ljubljana http://www.nameco.com
Europe

Brian
May 31st, 1999, 10:06 AM
For a book, I'd recommend Professional Visual Basic 5.0 Business Objects, by Rockford Lhotka, 1997, Wrox Press Ltd., ISBN: 1-861000-43-X. I understand that there's a VB 6.0 version out, but that it hasn't changed much from the VB 5.0 version.

Brian

Ravi Kiran
June 1st, 1999, 03:11 AM
You said it!!. I couldn't have said it better!

I perfectly endorse your view. Thats what i meant by "gives liverage". But, good planning is *the key*

Ravi

Tomaz Stih
June 1st, 1999, 04:10 AM
Loved the customer comments on Amazon.com. Will order, thanks a lot! This book is also available for VB 6.0 now.
The other one I found is VB6 UML Design and Development by Jake Sturm.

---------------------------------------------
Tomaz Stih, B.Sc.CS tomaz@nameco.com
Ob sotoccju 10 Nameco Group
SI-1000 Ljubljana http://www.nameco.com
Europe