main logo
Subject: Re: Business Object and its Interface
Author: Ed Leafe
Posted: 2001/03/13 20:07:18
 
View Entire Thread
New Search


<i><font color="#663300">Searching old messages I have found that everybody strongly recomend that business objects should not have any visual components. Like Pamela Thalacker writes: "The best design I have found is to make all business objects children of the form". I understand that it's the best way to get the n-tier philosofy

I have read too the article from C.T.Blankenship in the last NewsLetter and his particular way of implementing the tiers.
1) Build a Business Object, with no visual components: bo_Test
2) Build a Business Object Interface: boi_Test, subclassing bo_Test and adding all the visual components we need.
3) Build a Business Object Form, where to instantiate boi_Test
Really I can't see if this procedure is good or if is broking any rules of n-tier implementation. </font></i>

A business object exists to encapsulate business rules for accessing and modifying data. Ideally, this object should be re-usable, so that any app which needs to access that data can have a single class with which to interface. Once you add visual components to it, you've now tied that bizobj to a specific implementation. You've pretty much eliminated any possibility of re-using it anywhere else.

And what do you gain by adding the visual controls to the bizobj? Nothing, as far as I can see. The thing which ties the controls to the data is not the fact that they are physically contained in a bizobj; it's the setting of the ControlSource property for that control. <b>Nothing</b> about the behavior of visual controls depends on a containership relationship with the bizobj.

I've had discussions with CT about the approach he described in the newsletter, and he has said that his goal was to illustrate the "old" way of building apps in Codebook (i.e., combined GUI and business rules) in that issue, and then follow it up with another article describing how to create true n-tier apps. Unfortunately, his job responsibilities forced him to drop the newsletter, and that second article never got written. I don't see the point of illustrating how <i>not</i> to build an app; I think that the only approach should have been the n-tier one.
<font color="#cc0000"> ___/
/
__/
/
____/</font>
Ed Leafe
 
©2001 Ed Leafe
<-- Prior Message New Search Next Message -->