Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Business classes
Message
From
30/05/2001 12:23:23
 
 
To
30/05/2001 12:05:09
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00512722
Message ID:
00512736
Views:
8
>Hello,
>
>In my new application I try to use business objects that represent the entities, and these will be responsible for the data handling procedures as well as the user interfaces.
>
>I have one question:
>When I have child records, like many children for one person, they should be instantiated as objects on the Person class?
>
>How do I then display the children in a grid for example, when I want to bind the user interface objects only to the properties of objects instead of tables?
>
>What is the regular way of solving the problem of displaying object properties of many child objects?
>
>Thanks for your help in advance!

I've rearranged your questions a little.

If I were going to set this up, I would have a Parent object with a reference to a single Child object, as opposed to having many Child objects. The Child object would be responsible for several actions, such as getting all children
for a parent record, getting a single child record for editing, and so forth.

>Should the child class then create a record in a temporary table, that I could then use as source for a list or a grid?

Conceptually, yes. Assuming you are doing this in VFP, you would have a cursor that can be used as a source for list boxes, grids, and so forth.

The answer would change if you were using ADO. Although you'd still have the objects constructed the same, you'd need to use an ActiveX grid (as opposed to the native VFP grid) for multi-record display, as the VFP grid will not work with ADO recordset objects.

Hope that helps.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Previous
Reply
Map
View

Click here to load this message in the networking platform