Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wishlist???
Message
 
À
06/09/1999 20:19:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00260725
Message ID:
00261823
Vues:
50
>I REALLY wnated to stay OUT of this piece, but that last sentence go to me...
>
>Violation of encapsulation??? Well your method surely violates something even worse, or at the very least encapsulation! You have external coupling that is neither tight nor obvious, yet it is coupled nonetheless.
>Really, I seriously do feel that you are relying on observed but undocumented behaviour - it *is* documented that a dangling reference must be released before an object can be released, but rather than taking this as warning to ensure that this is done you are using this 'fact' to extend the life of objects. I have eyeballed the VFP 6 docs and have not found this recommended/described anywhere.

Jim,

You miss my point which is simply that RELEASE MyVar should release MyVar and nothing else.

My design is fully encpasulated because one routine cares nothing about what any other routine is doing. They do not affect each other at all. The key to my point is that a variable is NOT an object. A variable refers to an object and a single object may be referred to by many variables. Releasing one of those should have absolutely no effect on the others.

We do disagree and we certainly are at opposite extremes on this issue. The change you request to me is destructive change that would cause VFP to behave in an unexpected and erratic manor. Some routine far removed from another could blow away the objects on the other routine. Maybe even a programmer other than the one affected may issue a relase on a variable thinking it was the only reference to an object and cause entire esections of code to fail.

Encaplsuation says that no routine will cause side effects on any other routine and that everything a routine needs to function will be contained locally in that routine. Routine A blowing away an object that Rountine B is using is definitely a violation of encapsulation and it is tight external coupling because the two routines are intertwined with each other so tightly that a change in the code of one can render the other non-functional.

My position says that routine A can release its variable and that will have no effect on any other routine (how does that violate encapsulation?). Because routine B's actions have no effect on routine A, routine B doesn't even need to know that Routine A exists let alone care about what it needs to have preserve.

I realize that we disagree, but i think what you are asking for here is flat wrong and a very poor design.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform