I've just started using computed properties in a project, and I'm a bit confused with the implementation as I understand it:

Pros:
+Convenience of Methods
+Stored under properties & not mixed in the list of class methods

Cons:
-No overriding, which means I can't implement or re-implement the Get/ Set "Methods" in child classes.

The overriding thing is a bummer. Because I can't override the get/ set methods in child classes, I've pulled out all the computed properties in my parent/child classes and implemented them as methods. Now my child classes can implement/re-implement the get/set methods as necessary. (Sure, now these psuedo-properties are mixed into the methods list...)

So, um, I still feel like I'm missing something with computed properties. They seem like they offer the convenience of methods without their power, instead being constrained by the limitations inherent with properties, i.e., no child class re-implementation allowed.

I can understand that if overriding were allowed, polymorphism might slip in, and that might be undesirable. But I'm thinking it would be better if the compiler/IDE forbade polymorphic implementations of computed properties and just implemented them like methods, allowing them to be overridden only by parameters of an identical data type.

John



_______________________________________________
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