Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Non-visual parent source
Message
 
À
26/05/1999 08:07:28
Kenneth Downs
Secure Data Software, Inc.
New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00222349
Message ID:
00223011
Vues:
39
Forget the excusing, I'm applauding the long response. You got a lot in there. You should teach. I didn't get the zigzag idea at first since I'd never heard of such, but this time it is clear as a bell. You are saying that every new class can have representation on all your 3 levels by subclassing zigzag from 2 down to 1 and then back up to 2 again and then into 3. Brilliant. If I created a custom class based on custom on the 3rd level I really have no three level system for that class because I'm not likely to change the "custom" class at all. With your system, every new custom class has the three levels working for it. I'm going to have to let this sink in.

I have been thinking about trying out the FoxExpress as the independent business objects aspects is interesting. I got ObjectTalk from IAS last year and learned a lot from it, and Drew Speedie's framework also, but I always come back to my 3 level system. Thanks again.

>Terry,
>
>Well, I had a nice detailed response typed out, but lost the UT yesterday and it was gone, so here goes again:
>
>
>>> Thanks for the response. So FormEdit exists in your level3 library with parent in level2. <<
>
>OK so far.
>
>>> Yes my 3 levels are for the same reasons as yours
> seem to be.<<
>
>Still OK so far...
>
>>> If I put FormEdit in level3 and subclass Forms3.MyBaseFormsClass though it also gives FormEdit the qualities you mentioned. Which
> is best is my question. Once a person has a Forms3.MyBaseFormsClass on level3 library, should one not bypass it by subclassing back to level2? <<
>
>The answers to this question and your remaining questions come down to making a decision and then going with it. When I first came up with 3-level classes, for the reasons we both have, I wrangled with this. I finally realized that, mathematically, the number of possible inheritance chains is infinite once you begin zig-zag inheritance. Therefore, a design decision had to be made.
>
>So we aren't so much deciding the best way to do this in an absolute sense so much as we are finding the best way to get the flexibility we want, and throwing away everything else. So it helps to go back to the example.
>
>Forms1.MyFormBaseClass (the parent of all forms throughout the framework)
>
>Forms2.MyFormBaseClass (this can be modified safely to affect all forms in the framework w/o hitting proven code)
>
>Forms1.FormEdit (inherits from Forms2.MyFormBaseClass. Contains all framework code and properties that define an editing form. In my case, it just contains a toolbar manager)
>
>Forms2.FormEdit (this can be modified safely to affect all editing forms in the framework w/o hitting proven code)
>
>Forms3.FormEdit (one copy of this in each project. Actual forms are instantiated from here)
>
>By "zig-zagging" only from level 2 back to level 1 you achieve all of the flexibility you need, and more than most need.
>
>The big advantage of this is that two like-minded developers can share a framework and hand improvements back and forth to each other via the middle layer. That's really why I did it.
>
>Some other points:
>There is only one copy of Forms1.VCX and Forms2.VCX, common to all projects. There is a copy of Forms3.VCX in each project directory. Of course, the same applies to Controls1.vcx, ActiveXControls.VCX, and so on.
>
>In practice, I have found that I never modify the project-specific libraries at level 3, though I keep this structure just in case. It seems that anything worth doing for one project is always worth putting into the framework at the bottom level, with some options for turning it off and on.
>
>One thing worth mentioning is that this works for me because I have a flattened form heirarchy, using only 3 form classes for just about everything. These are FormEdit, FormReport, and FormBatch. I don't buy into the philosophy of creating FormEdit, FormEditFlat, FormEditOneToMany and so one, it offends my sense of the general-purpose.
>
>Finally, it wouldn't be fair not to mention that this also works because I have comparitively little code in my forms. The MyFormBaseClass contains hooks to call drop-on objects (sort of fake ActiveX controls, if you will), so when I need to modify a form, I make up a custom class and drop it onto the form or form class. So far I've only need two of these.
>
>Finally, I myself bought a commercial framework about 18 months ago, and made my money back on the guinea-pig project (I think my testimonial is still up at www.promatrix.com). After I learned everything I could from it, I became impatient with it for many reasons and returned to my old power-hungry do-it-yourself habits.
>
>Please excuse the long-winded response, but nobody has ever brought up three-level class structures before, and it is something I'm very happy with.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform