Hi all
Let's say I have five classes (Class1, Class2 etc.) and that each class is a subclass of the one before it (class2 is a subclass of class1, class3 is a subclass of class2 etc.)
Now let's suppose that I have added a custom property (e.g. "MyProperty") to class3 and set its value to "Property3". At this point class4 and class5 will inherit the property MyProperty with the value "Property3".
Now I add the custom property MyProperty to class1 and set its value to "Property1" and everything is just fine.
Now class2 will inherit the property MyProperty with the value "Property1" and classes class3, class4, class5 will inherit the property MyProperty with the value "Property3".
I think that's great and potentially very useful because it means I can create a property at the top of the hierarchy without having to worry about whether a property of the same name has already been defined lower down the hierarchy.
Paul Newton
Yes, that work, but take care of using more than 3 subclass levels, because sooner or later you could start having a nightmare with code maintenance and even strange errors. VFP doesn't always do a very good job with many subclass levels.
El 31/3/2017 16:22, "Paul Newton" Paul.Newton@pegasus.co.uk escribió:
Hi all
Let's say I have five classes (Class1, Class2 etc.) and that each class is a subclass of the one before it (class2 is a subclass of class1, class3 is a subclass of class2 etc.)
Now let's suppose that I have added a custom property (e.g. "MyProperty") to class3 and set its value to "Property3". At this point class4 and class5 will inherit the property MyProperty with the value "Property3".
Now I add the custom property MyProperty to class1 and set its value to "Property1" and everything is just fine.
Now class2 will inherit the property MyProperty with the value "Property1" and classes class3, class4, class5 will inherit the property MyProperty with the value "Property3".
I think that's great and potentially very useful because it means I can create a property at the top of the hierarchy without having to worry about whether a property of the same name has already been defined lower down the hierarchy.
Paul Newton
[excessive quoting removed by server]
On 2017-03-31 10:45, Fernando D. Bozzo wrote:
Yes, that work, but take care of using more than 3 subclass levels, because sooner or later you could start having a nightmare with code maintenance and even strange errors. VFP doesn't always do a very good job with many subclass levels.
I've always tried to never go more than 3 deep. My corporate gig has me digging 11+ levels at times. Needless to say, it's an "Excedrin moment" when I have to debug that. The developers are of a genius level--really, so GREAT minds--but I don't like the complexity cost. I'd rather slightly less than lightspeed performance if it means easier code maintenance.
On 08/04/2017 00:50, mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
I've always tried to never go more than 3 deep. My corporate gig has me digging 11+ levels at times. Needless to say, it's an "Excedrin moment" when I have to debug that. The developers are of a genius level--really, so GREAT minds--but I don't like the complexity cost. I'd rather slightly less than lightspeed performance if it means easier code maintenance.
If you have to go up to 11 levels deep in classes I can't see you getting light speed performance. I could be wrong but have heard of other apps heavily subclassed having speed problems. That would mean you have an app that is hard to debug and not that fast.
I have classes (toolbars and other controls) that are on several forms so I can re-use the functionality, but 11 levels deep? What could possibly be that complex?
Peter
This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
www.whisperingsmith.com
Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715
London Office:17-19 Foley Street, London W1W 6DW Tel:0207 299 7960
In my experience, that's bad design.
If you need geniuses to modify that, then that's mean that it's not intended to be maintained by someone else, so expect a high cost of maintenance, and pray that those devs don't let you down.
El 10/4/2017 12:14, "Peter Cushing" pcushing@whisperingsmith.com escribió:
On 08/04/2017 00:50, mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
I've always tried to never go more than 3 deep. My corporate gig has me digging 11+ levels at times. Needless to say, it's an "Excedrin moment" when I have to debug that. The developers are of a genius level--really, so GREAT minds--but I don't like the complexity cost. I'd rather slightly less than lightspeed performance if it means easier code maintenance.
If you have to go up to 11 levels deep in classes I can't see you getting light speed performance. I could be wrong but have heard of other apps heavily subclassed having speed problems. That would mean you have an app that is hard to debug and not that fast.
I have classes (toolbars and other controls) that are on several forms so I can re-use the functionality, but 11 levels deep? What could possibly be that complex?
Peter
This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email. www.whisperingsmith.com
Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715 London Office:17-19 Foley Street, London W1W 6DW Tel:0207 299 7960
[excessive quoting removed by server]
I guess that the requirement for 11 levels must be due to multiple variations of the same class being required depending upon the specification of the class environment.
This would be better served using a class factory. That way the classes could be discrete and easily maintained.
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Fernando D. Bozzo Sent: 10 April 2017 11:51 To: ProFox Email List profox@leafe.com Subject: Re: Retrospective properties - the magic of inheritance
In my experience, that's bad design.
If you need geniuses to modify that, then that's mean that it's not intended to be maintained by someone else, so expect a high cost of maintenance, and pray that those devs don't let you down.
El 10/4/2017 12:14, "Peter Cushing" pcushing@whisperingsmith.com escribió:
On 08/04/2017 00:50, mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
I've always tried to never go more than 3 deep. My corporate gig has me digging 11+ levels at times. Needless to say, it's an "Excedrin moment" when I have to debug that. The developers are of a genius level--really, so GREAT minds--but I don't like the complexity cost. I'd rather slightly less than lightspeed performance if it means easier code maintenance.
If you have to go up to 11 levels deep in classes I can't see you getting light speed performance. I could be wrong but have heard of other apps heavily subclassed having speed problems. That would mean you have an app that is hard to debug and not that fast.
I have classes (toolbars and other controls) that are on several forms so I can re-use the functionality, but 11 levels deep? What could possibly be that complex?
Peter
This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email. www.whisperingsmith.com
Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715 London Office:17-19 Foley Street, London W1W 6DW Tel:0207 299 7960
[excessive quoting removed by server]
_______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/CAGQ_JunZk8P3KrCM01W2rtOy84WZSyjuGKPR... ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
It's also one hell of a way to create a simple sometimes naive self-destruct button! ;)
On Fri, Mar 31, 2017 at 10:22 PM, Paul Newton Paul.Newton@pegasus.co.uk wrote:
I think that's great and potentially very useful because it means I can create a property at the top of the hierarchy without having to worry about whether a property of the same name has already been defined lower down the hierarchy.