Information générale
Catégorie:
Programmation Orientée Object
>>We are having trouble passing parameters to an object.
>>Then intention is to encapsulate the functionality of the object by not allowing the user to change the properties directly.
>>I've been thinking about usin the Access and Assing methods to control wich properties and what values do I allow the external program to change and when to let them change it, depending on the current conditions of the object.
>>Some of the goals that we are trying to achieve are,
>>ability to alter all inputs.
>>Ease in standard usage.
>>Encapsulation.
>>Flexibility and maintenance. (For instance if I wan't to send parameters to a method and at some point I do not need one of them, I don't have to receive that parameter anymore)
>>
>>Thanks for any help.
>
>Can you post the code you're having difficulty with.
Well, I don't know what do you mean by post, but what we are doing right now is using a method to set properties to an object, like a mStore method, for example if I want to change a property called price I'll do a mStore("rnPrice", 50.25) and that method will take care of the change. If in the future we don't need the price property, the mStore method won't do anything when we call that method with that parameter, so we don't have to change any code that already exist in the system and in future code that will be ignored.
Now I'm thinking that I can use the Assign method and access method to control the access to variables and do processing based on that.
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