Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What should I return ...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00749629
Message ID:
00749639
Vues:
22
>I am creating class that builds a tree of objects and ending up with a collection of collections. See below. I am getting the impression that a procedure call like this:
>
>loFooBranch = CreateObject([Collection])
>loFooBranch = this.getFee(Feepk, loFooBranch)
>
>May be bad practice. In the procedure getFee another object is added to the loFooBranch passed.
>
>Should I be doing this instead?
>
>loFooBranch = CreateObject([Collection])
>loFiReturn = this.getFee(Feepk)
>loFooBranch.add(loFiReturn.name, loFiReturn)
>
>
>Any thoughts?

I kind of get the same impression you do, but I really can't think of any problem with the first syntax. Given a choice, I'd go with the second, because it seems to me that that makes it more obvious what you're doing, and hence more maintainable down the line.

(BTW, you misspelled GetFo, and left GetFum out of your sample altogether.)
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform