Well, so you don't add a rpm property when you are dealing with an interface
of toasters and vacuum cleaners. But if you are dealing with vacuum cleaners
and washing machines? Or toasters and ovens (temperature)?

I'll just use Get and Set methods, but I still think it should be allowed.

Maarten


On 02/05/06, Jason Essington <[EMAIL PROTECTED]> wrote:


On May 2, 2006, at 11:10 AM, Maarten de Vries wrote:

> That's a good idea... But I dont get why it's not possible. I don't
> see a
> reason why it shouldn't be possible. There is probably a very good
> one, but
> I dont see it.
>

The job of an interface is to define, the interface that will be
presented to your application by the implementing objects. These
objects may be very disparate things. When you start adding
properties to your interface, you are all of a sudden trying to add
implementation details, which is expressly not what an interface is for.

Your toaster and your vacuum both implement power plug for instance,
but they are very different objects, and it would be inappropriate
for the interface to require a motor rpm property when a toaster
doesn't even have a motor.

So, technically RS could add the ability to place properties into an
interface, but it is bad form, and should not be (and currently is
not) allowed.

perhaps what would be more appropriate in your situation would be an
abstract class (not yet available in RB, perhaps there should be a
feature request) which can define partial behavior for a group of
objects, while still requiring that some methods be implemented.

For instance you could have an abstract vacuum class that was
extended by both Kirby, and Dyson. again, the end objects are very
different, but they do share some base behavior.

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

_______________________________________________
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