Hi one and all,
This is a general question, related to the theoretical organization of OOP and CB.
Not being in the centre of the Coding community this may seem an odd question but I am not sure of the distinctions between USER Services, BUSINESS Services and Data services.
By way of example....
USER or BUSINESS
In the CB world Is a Combobox in a bizobj Proper to a user service or a Business Service. If this same cbo is directly in a formobj is its theoretical classification different.
BUSINESS or USER
Are CB's BizObjs BUSINESS services or USER services as they are the interface between the underlying data and the user.
Should Classes like "MySpecialProxyListBox" be classified as a User Class or a Business class as it would presumably be the interface to the user but located in a bizobj.
BUSINESS or DATA
As business object undertake the creation and saving of the views data in CB are they Data services or Business services.
This may seem "OLD Hat to many of you but I am playing "Catchup"
Thanks in advance to all you theoreticians
Geof Whitham
Penang,Malaysia
<b>User Services</b>... basically, UI controls and coding that is responsible for interacting with the user. Things such as presenting data, accepting input, showing messages to the user, etc. (cForms.vcx, cControls, etc.)
<b>Business Services...</b> this entails classes and code the is reponsible for defining business domian rules... Things like, If a customers credit rating is 4 they can order up to $5,000 per month on credit. Or, this may be code that posts GL transactions. (Business objects, generally, there are still some UI stuff in CB bizobjects. Also, there is no current way in CB to physically seperate the User and Business tiers.)
<b>Data Services...</b>... this is generaly the physical manipulation of the data and the integraty thereof seperate from the bizrules. Handels saves, generating keys, cascade deletes, audit trails, etc. (This is generally a combination of the data behavior objects and the VFP data engine (.DBC definitions) or SQL server or other basckend you are using.)
BOb
BOb
<I><FONT COLOR="#663300">Not being in the centre of the Coding community this may seem an odd question but I am not sure of the distinctions between USER Services, BUSINESS Services and Data services.</FONT></I>
I see that Bob has already given you a good explanation of the different services, or tiers, in Codebook.
<I><FONT COLOR="#663300">USER or BUSINESS
In the CB world Is a Combobox in a bizobj Proper to a user service or a Business Service. If this same cbo is directly in a formobj is its theoretical classification different.</FONT></I>
This is one of the problems with Codebook as it originally existed: it mixed the elements of the presentation layer and the business layer. Its examples included bizobjs with contained controls; even the choice of basing the cBizobj class on the VFP base class of "Container" instead of "Custom" reflects this design.
The important thing to remember is that there is absolutely nothing in Codebook which <I>requires</I> that you mix the two. I have created many apps with non-visual bizobjs, and they work perfectly well.
<I><FONT COLOR="#663300">BUSINESS or DATA
As business object undertake the creation and saving of the views data in CB are they Data services or Business services.</FONT></I>
They are business services, but the actual saving, requerying and opening of views does not take place in the bizobj, but rather in the DataBehavior object to which the bizobj has a reference. That way if you ever wanted to work with a data source which did not lend itself to VFP views, you could write a new DataBehavior class to handle the translation, and the bizobjs would work without change.
<font color="#cc0000"> ___/
/
__/
/
____/</font>
Ed Leafe
Author: AMS Computing, computing@dial.pipex.com
Posted: 1999-09-14 09:22:58 Link
Okay so I am thick, but does the Polymorphism donkey upset Inheritance cart?
Using an example from a book to explain Poly...
*****
DEFINE CLASS xPoly AS custom
PROC show
WAIT WINDOW 'This is the root class'
ENDPROC
ENDDEFINE
DEFINE CLASS xPolyChild AS xPoly
PROC show
? 'This is the child of xPoly'
ENDPROC
ENDDEFINE
SET PROC TO ...
oTest = CREATEOBJECT('xPolyChild')
oTest.Show()
****
Only shows the child not the parent, unless I included DODEFAULT() in
xPolyChild.Show
Is this correct, it does make sense?
regards
Stuart Hurley
ams_ltd@dial.pipex.com
Author: Michael Babcock, mbabcock@kepro.org
Posted: 1999-09-14 09:44:14 Link
Makes sense to me, because without the dodefault(), your child proc (Show) is
overriding the inherited code.
HTH,
--Mike
>>> "computing@dial.pipex.com" 09/14/99 09:37am >>>
####################################################
The following message part was sent with the unknown
character set: "WINDOWS-1252"
####################################################
Okay so I am thick, but does the Polymorphism donkey upset Inheritance cart?
Using an example from a book to explain Poly...
*****
DEFINE CLASS xPoly AS custom
PROC show
WAIT WINDOW 'This is the root class'
ENDPROC
ENDDEFINE
DEFINE CLASS xPolyChild AS xPoly
PROC show
? 'This is the child of xPoly'
ENDPROC
ENDDEFINE
SET PROC TO ...
oTest = CREATEOBJECT('xPolyChild')
oTest.Show()
****
Only shows the child not the parent, unless I included DODEFAULT() in
xPolyChild.Show
Is this correct, it does make sense?
regards
Stuart Hurley
ams_ltd@dial.pipex.com
********************************
Michael Babcock
KePRO, Inc.
Tel: 717-564-8288
Fax: 717-564-4188
Internet Address: mbabcock@kepro.org
Home Page: http://www.kepro.org
********************************
Author: Mary Hintermeier, mhinterm@RSA-NET.COM
Posted: 1999-09-14 09:46:44 Link
You got it exactly right Stuart.
The beauty of subclassing and VFP is that you can completely override the
behavior of a method in a subclass and the class interface doesn't change.
A better design may have been to have an AbstractPoly class which has just an
Empty Show method() and then subclass into PolyWaitWindow and PolyPrint
AbstractPoly Show method does nothing
PolyWaitWindow Show method shows stuff via WAIT WINDOW
PolyPrint Show method show stuff via ?
Although the implementation of the Show method in each subclass is different,
the interface into the object remains the same in all classes. So if I want to
write a program which initially does wait windows I can do
At design time or in a separate program/class I can do
this.cPolyClassToInstatiate = 'PolyWaitWindow'
In a standard program used regardless of the actual implementation of the Show()
method
loPoly = CREATE(this.cPolyClassToInstatiate)
loPoly.Show()
And then later, if I change my mind, I just have to change the calling
program/class to do
this.cPolyClassToInstatiate = 'PolyPrint'
"AMS Computing" <computing@dial.pipex.com> on 09/14/99 09:22:58 AM
Please respond to profox@leafe.com
To: Multiple recipients of ProFox <profox@leafe.com>
cc: (bcc: Mary Hintermeier/RSA)
Subject: VFP6 & OOP - newbie question
Okay so I am thick, but does the Polymorphism donkey upset Inheritance cart?
Using an example from a book to explain Poly...
*****
DEFINE CLASS xPoly AS custom
PROC show
WAIT WINDOW 'This is the root class'
ENDPROC
ENDDEFINE
DEFINE CLASS xPolyChild AS xPoly
PROC show
? 'This is the child of xPoly'
ENDPROC
ENDDEFINE
SET PROC TO ...
oTest = CREATEOBJECT('xPolyChild')
oTest.Show()
****
Only shows the child not the parent, unless I included DODEFAULT() in
xPolyChild.Show
Is this correct, it does make sense?
regards
Stuart Hurley
ams_ltd@dial.pipex.com
Author: Bourque, Chad, Chad@teche.net
Posted: 1999-09-14 09:52:33 Link
Stuart,
This is correct. You are overriding xPoly.Show() with xPolyChild.Show(),
not appending to it. The DoDefault() makes an explicit call to the Parent
method of the same name. This gives you the ability to add code before
and/or after the parent code or, as you have demonstrated, override the
parent code. Sample of before and after:
Proc Show
Wait Window 'This is Child Before Parent'
DoDefault()
Wait Window 'This is Child After Parent'
EndProc
HTH
Chad Bourque
U.S. Bankruptcy Court - 11th Circuit
Alabama - Northern District - Southern Division
Chad@teche.net
----- Original Message -----
From: AMS Computing <computing@dial.pipex.com>
To: Multiple recipients of ProFox <profox@leafe.com>
Sent: Tuesday, September 14, 1999 8:22 AM
Subject: VFP6 & OOP - newbie question
: Okay so I am thick, but does the Polymorphism donkey upset Inheritance
cart?
:
: Using an example from a book to explain Poly...
:
: *****
: DEFINE CLASS xPoly AS custom
: PROC show
: WAIT WINDOW 'This is the root class'
: ENDPROC
: ENDDEFINE
:
: DEFINE CLASS xPolyChild AS xPoly
: PROC show
: ? 'This is the child of xPoly'
: ENDPROC
: ENDDEFINE
:
: SET PROC TO ...
: oTest = CREATEOBJECT('xPolyChild')
: oTest.Show()
: ****
:
: Only shows the child not the parent, unless I included DODEFAULT() in
: xPolyChild.Show
: Is this correct, it does make sense?
:
: regards
:
: Stuart Hurley
: ams_ltd@dial.pipex.com
:
:
:
Author: Andy_Davies/ITUnit/MCC@notes.manchester.gov.uk
Posted: 1999-09-14 09:56:50 Link
"Is this correct, it does make sense?"
Seems OK to me too, but I'm not very OOPy.
BTW if you do DODEFAULT() you then get :
1) a ? message
2) a wait window
both generated by your SHOW() - thus exhibiting a simple polymorphism in
the SHOW method.
Author: Anders Altberg, anders.altberg@swipnet.se
Posted: 1999-09-14 10:45:21 Link
That's how VFP works. Userdefined code is always overridden unless the
superclass code is called with :: or dodefault(). Baseclass behavior is
never overridden unless stopped with NODEFAULT. Other OOP implementations
work the other way around. There's no one right way.
-Anders
----- Original Message -----
From: AMS Computing <computing@dial.pipex.com>
To: Multiple recipients of ProFox <profox@leafe.com>
Sent: tisdag den 14 september 1999 15:22
Subject: VFP6 & OOP - newbie question
| Okay so I am thick, but does the Polymorphism donkey upset Inheritance
cart?
|
| Using an example from a book to explain Poly...
|
| *****
| DEFINE CLASS xPoly AS custom
| PROC show
| WAIT WINDOW 'This is the root class'
| ENDPROC
| ENDDEFINE
|
| DEFINE CLASS xPolyChild AS xPoly
| PROC show
| ? 'This is the child of xPoly'
| ENDPROC
| ENDDEFINE
|
| SET PROC TO ...
| oTest = CREATEOBJECT('xPolyChild')
| oTest.Show()
| ****
|
| Only shows the child not the parent, unless I included DODEFAULT() in
| xPolyChild.Show
| Is this correct, it does make sense?
|
| regards
|
| Stuart Hurley
| ams_ltd@dial.pipex.com
|
|
|
Author: Anders Altberg, anders.altberg@swipnet.se
Posted: 1999-09-14 10:51:45 Link
Jerry
Nodefault doesn't prevent the parentclass from running, it prevents the
baseclass behavior from doing its stuff.
-Anders
----- Original Message -----
From: Cotton Jerry P <CottonJP@2mawcp.usmc.mil>
To: Multiple recipients of ProFox <profox@leafe.com>
Sent: tisdag den 14 september 1999 18:55
Subject: RE: VFP6 & OOP - newbie question
| As I understand inheritance (if I'm confused somebody straighten me out)
|
| When you put code in the child property you are overriding the code that
is
| in the parent class, thus the behavior that you note. DODEFAULT()
| explicitly calls the code of the parent class just as NODEFAULT explicitly
| prevents the parent code from running.
|
| The following shows both statements.
|
| oTest = CREATEOBJECT('xPolyChild')
| oTest.Show()
| DEFINE CLASS xPoly AS custom
| PROC show
| WAIT WINDOW 'This is the root class'
| ENDPROC
| ENDDEFINE
|
| DEFINE CLASS xPolyChild AS xPoly
| PROC init
| ? 'This is the child of xPoly'
| ENDPROC
| ENDDEFINE
|
| Mr. Jerry Cotton MCP
| 2nd Marine Aircraft Wing Comptroller's Office
| MCAS Cherry Point NC
| mailto:cottonjp@2mawcp.usmc.mil
| (252)466-2320 fax (252)466-4806 DSN-582
|
|
| -----Original Message-----
| From: AMS Computing [mailto:computing@dial.pipex.com]
| Sent: Tuesday, September 14, 1999 9:23 AM
| To: Multiple recipients of ProFox
| Subject: VFP6 & OOP - newbie question
|
|
| Okay so I am thick, but does the Polymorphism donkey upset Inheritance
cart?
|
| Using an example from a book to explain Poly...
|
| *****
| DEFINE CLASS xPoly AS custom
| PROC show
| WAIT WINDOW 'This is the root class'
| ENDPROC
| ENDDEFINE
|
| DEFINE CLASS xPolyChild AS xPoly
| PROC show
| ? 'This is the child of xPoly'
| ENDPROC
| ENDDEFINE
|
| SET PROC TO ...
| oTest = CREATEOBJECT('xPolyChild')
| oTest.Show()
| ****
|
| Only shows the child not the parent, unless I included DODEFAULT() in
| xPolyChild.Show
| Is this correct, it does make sense?
|
| regards
|
| Stuart Hurley
| ams_ltd@dial.pipex.com
|
|
|
|
|