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: Karen <keatk@verizon.net>
Date: Thu, 27 Nov 2008 09:48:20 -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: <89FEA483-007C-4CD8-9D64-5A47B6D0A57F@great-white-software.com>
References: <4F4D1ADF-52CE-4EBA-9346-9BE37992CCDD@xochi.com> <1ED2BB86-1E43-4A4C-8245-F8D587E28BC2@great-white-software.com> <BFB05065-1FC3-4400-A27F-1448615FFD11@xochi.com> <33cbfa100811261510l7803122fu2592dd1d7f03848b@mail.gmail.com> <421C4E27-0784-4D03-B28D-EB52A783BADE@great-white-software.com> <33cbfa100811261628h68d4a3c2xd11a3ca8d3c9881e@mail.gmail.com> <007DA3B0-FAE4-4E85-81E4-A0122C860DC1@great-white-software.com> <D777EFE4-6977-4EA2-A3C0-EC3609BBB2C0@verizon.net> <89FEA483-007C-4CD8-9D64-5A47B6D0A57F@great-white-software.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Nov 27, 2008, at 12:40 AM, Norman Palardy wrote:

To the consumer of that class there's no difference between the method pair and a property (which I've always really liked in RB)

Depends on how you define consumer. I define it as the coder who is using the class as a building block not only for the app as a whole but also for subclasses... Methods can be overridden , properties can not. HUGE difference. So there are significant different to the "consumer" for me. You can not be TOTALLY blind to implementation details when using intrinsic and 3rd party classes without introducing to hard to find bugs.

AND it allows implementors the flexibility to implement that "property" however is appropriate for that implementation. That's entirely the point of an interface - tie every implementor to an API NOT the specifics of how to implement it.

And that would be fine IF we wrote all the classes (and methods) we used we wrote ... But We don't define the framework classes or 3rd party plug-in or encrypted classes... That is why I called the view you hold as an ideological one and not a practical one. In the abstract you have a point... In the real world it just makes things more difficult for us then they need to be.

BTW on a more mundane level, I find computed properties to be superior to getter setter pairs (unless i need to override them) because they help organize the class contents better. A long list of methods are hard to read. Using computed properties mean only one entry in the list (if the widget is closed). Also having all properties (pseudo or not) group is a other logical tool I find helpful for self documentation and "re-learning" classes i wrote a while back.

Anyway being able to define properties as part of the interface contract would make our lives a bit easier and I still don't see the PRACTICAL (from a language perspective) downside... Why it would be a bad thing,

I realize it might be a lot work under the hood ... but that is a different issue than it's desirability. There is a reason it keeps coming up year after year on the list!

- karen

_______________________________________________
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>