Information générale
Catégorie:
Programmation Orientée Object
Hi Chaim,
> But I don't see what's the problem with code that depends on the instantiation order of objects in a container.
For starters, it breaks when you're modifying that container next year (or for me, tomorrow <g>) and *forget* that the objects need to be instantiated in a certain order. You inadvertently change that order and then you've got a debugging situation you don't need to have. Particularly when the requirement, as stated, is at best questionable. ;-)
That's the antithesis of object oriented programming, where no object should be unduly bound by contrived dependency.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement