On Mar 9, 2006, at 10:39 AM, John Balestrieri wrote:

Hi Phil, all good points, but the points, but the thing I seem to be missing in my understanding is why they were implemented to not allow overriding.

Because they are implemented as Properties, and Properties cannot be overridden.

It would be like having a basic Integer property in the Super class and then have another basic Integer property with the same name in the subclass... which one does REALbasic use? This is a silly example because basic Integers are just a space in memory which holds data so you shouldn't really ever need to override a basic property.

Computed Properties are designed to behave exactly like basic properties including the inability to override. This is a design decision and I don't know the reasons behind the design... it just is (sorry). My personal opinion is that I like this behavior as it creates a bit of protection for properties that should not be modified by subclasses, and yet provides full access to the data "held" by the computed property. For example, if you have an Array Wrapper class, you can have a Computed Property "Count As Integer". A subclass should have no reason to override the Count behavior, so a computed property is better than a Method.

Computed Properties are a nice addition and I use them all of the time. However, if you are wanting to override a computed property then computed properties are not the right design decision for your class -- instead creating accessor methods is the correct (and only) thing to do.

If you do not like this behavior, then submit a feature request.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to