10-03-2006 12:17 PM
10-03-2006 02:10 PM
Mr. Bean,
It is hard to answer this question quickly but here is my attempt. With OOP or GOOP you always will need a create and a destroy. Create will create the private and public data that is part of the class. Create is a good place to add initialize code because it will then auto-initialize every time create is called. Each time you call create it will will make a new instance and in most cases you only want on instance of a class. You use destroy to remove the class and clean up the memory.
Multiple instances makes your code scalable. Let say you have one switch box then you add a second one. You can create a second instance with the address of the new box and you are done! This means you will get all the data and methods needed to operate on this second box just by creating a second instance.
Use Create to initialize, use set to change a property, and use get to return data from the class. Private Data can only be accessed by the class but Public Data can be accessed outside of the class. Properties act on data and Methods do something. It is more involved than this but have to get back to work.
Hope this helps,
10-03-2006 03:27 PM - edited 10-03-2006 03:27 PM
Message Edited by MJBrehm on 10-03-2006 03:27 PM
10-03-2006 03:49 PM
Not sure what you mean by, "Auto Garbage Collection". I am not sure but it will release memory when you close the application but may not release it when the program ends. It is proper to destroy what you create just like closing a serial port if you open it. Doesn't hurt!
10-11-2006 01:09 PM
10-11-2006 05:20 PM
10-12-2006 05:42 AM
10-13-2006 10:35 AM
I am in sync now. The comments I made were in reference to the GOOP Wizard from Endevo. Had to stop doing my regular job and spend a few hours playing with 8.20.
General comments:
- Do not like the fact that you can't call a destructor. I feel this is an important part of OOP and dynamic programs were resources can be added and removed On-The-Fly
- Changed the class icon after I started to code. I had t go back manually and change the icons so make sure you do this when you create the class. An auto update option would be nice simular to Icon Wizard.
- You have to use Shift Registers to maintain the state of the private data. Using references would be a better way so you don't have to always pass data using SR.
On the plus side, very easy to use and get results quickly