Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameters to objects.
Message
From
07/07/1999 16:11:26
 
 
To
07/07/1999 16:05:16
Fabian Valencia
Calamos Asset Managment Inc.
Naperville, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00238265
Message ID:
00238495
Views:
9
>>>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.

Ok. I think I understand. Actually having a central method which stores, you could check for the existence of the property and disregard the call if the property no longer existed. If you made a rnPrice_Assign, rnPrice_Access and then deleted that property with those methods, the line used to access the or assign would bomb out.

Dan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform