Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OOP recommendations, please
Message
From
23/06/2000 01:55:59
 
 
To
22/06/2000 20:07:08
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00383528
Message ID:
00383624
Views:
21
>Hi,
>
>I have a large app that I am moving to VFP. I have been doing things in a very non OOP way.
>
>Frequently used routines reside in the start up program, in a procedure file, or in separate files if they are large. Setup code for reports resides right in menu snippets. There are also a lot of calculation routines in the procedure section of the forms that need those calculations.
>
>Lastly, I use global variables to hold some frequently used values that I do not wish to fish repeatedly from the parameter table.
>
>I wish to follow good OOP practice. A friend suggested three main objects: oApp, oBiz, and oDS (for data services). While these are good classifications those objects will quickly become bloated and it will be hard to find things.
>
>I am thinking of adding the following objects:
>
>1) oCalc. To hold calculation methods. One method, for example, may calculate accrued vacation.
>
>2) oReports. Its methods would setup reports as well as call the report itself.
>
>3) oValues or something like that to hold a bunch of values that I need quick access to. These are awfully much like global variables, but at least they are loaded upon object instantiation and therefore are more standalone.
>
>What are natural subcategories that people use ?
>
>TIA,
>
>Alex

To expand on Larry's reply. Make you objects model real world things. oEmployee, oInvoice, oPart, etc. You'll then have methods like oInvoice.CalcTax, oInvoice.CalcShipping, oInvoice.CalcTotal.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform