Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Too many ojects load?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00044530
Message ID:
00045351
Vues:
69
>>What would be the importance of the GRID being a member of a container?
>>Do I want to have containers if I want to put objects in a group?
>>or...
>>is there another reason for having containers?
>Robert,
>
>
>Your question belies an need to understand containership as a desing issue in OO development. Contianreship allows us to provide a heirarchical strucutre to the objects that our system incorporate. This heirarchy is in addition to the inheritence heirarchy provided by subclassing classes. For example imagine a form with a pageframe with two pages, the containership is as follows.
>
> Form -------> PageFrame --------> Page1 -----> Textbox (Name Text1)
> |--------> Page2 -----> TextBox (Name Text1)
>
>Notice that both textboxes have the same name, that is possible because they "live" in different places the first one lives at THISFORM.PageFrame1.Page1.Text1 and the second at THISFORM.PageFrame1.Page2.Text1. PageFrames are easy to see this with but they don't really explain the reason to create a container as they provide a unique feature to the user interface and may be used for that reason rather than purely for the containership.
>
>Why might I create a container class with controls inside of it? ecause those controls must interact with each other and are often
>used together. By putting htese controls in a container I can write code in them that refers to each other without that code being dependant on the names of anything but the controls.
>
>For example, imagine I have created a container class that has a textbox (Text1) and a command Button (command1), in the commadn button's code I can refer to the textbox using;
>
> THIS.Parent.Text1
>
>This code works if the name of the continer is MyBigContainer and it works if the container's name is Junk. It works if the container is in a form or in a page of a pageframe or even in a pgae of a pageframe that is in a page of a pageframe. IOW, this code is functional independently of where you put the container. In addition, the fact that the two objects (text1 and command1) work together you are assured that they will never exist without the other because they are both part of a larger class (the container).
>
>I would suggest that you add some reading to your must read list on the subject of Object Oriented Analysis and Design. A good first author is David Taylor. Then try Yourdan and/or Wirfs-Brock followed by Jacobsen and Booch. Don't start with the last authoars as you will likely become discouraged very quickly with them.

Jim

Thanks for the lesson in containers. I too have used them primarialy for visual display to make life easier for the user. I hadn't thought of them as a real programming tool; still think too much procedural :).
Dallen K. Delk, Jr.
ddelk@nngov.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform