realbasic-nug
[Top] [All Lists]

Re: Interfaces and Computed Properties

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Interfaces and Computed Properties
From: "lists@mgreg.com" <lists@mgreg.com>
Date: Sun, 30 Nov 2008 12:38:51 -0500
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <48C32B27-B0F0-4505-8277-E06B3E1E6332@declareSub.com>
References: <C5588416.23A9B%tt@tempel.org> <48C32B27-B0F0-4505-8277-E06B3E1E6332@declareSub.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Nov 30, 2008, at 12:25 PM, Charles Yeomans wrote:



I don't see why this would be a good idea. Currently, one can add get/set method pairs to an interface. This provides one with a way to add things with the property look-and-feel to an interface. Computed properties provide a way to add more or less the same thing to a class, and prevent them from being overridden. Also, when writing this feature request, don't forget to take return-type covariance into account.


Charles Yeomans


....playing off-the-cuff semi-demi devil's advocate...

Say you've implemented an Observer Pattern. What if you (for some reason) wanted to track all instances of observers with a shared property? Granted you could scour the application at run-time for each "Observable" and have it give up the names of all the items observing it, but it would be much nicer if you could have a single property that gets incremented when you "Register" a new Observer.

I could likely think of a couple more instances where it would be useful, but that's the first thing that came to mind in the 30 seconds I read over this thread.


Best,
Michael

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

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>