No... and yes.
No - technically a class interface only specifies the methods
(Subs/Functions) that a class MUST implement if it uses the interface -
it says nothing about data storage of the class in question (instance
variables.)
But, if you were paying attention, you'll note that I said Subs and
Functions. Well, you can have a sub/function pair that acts like a
property - and this IS allowed by a class interface; so - in that
context - yes, you can have 'properties' in a class interface. They
just won't store anything (since you can't instantiate an interface
anyway.)
So, if you have - for example - a class interface IProperties like:
Interface IProperties
Public Sub Foo(Assigns i As Integer)
Public Function Foo() As Integer
End Interface
and you use (inherit) this interface in some other class, CTest, then
instances of CTest have to have (for all intents and purposes) a
'virtual'* public property Foo As Integer, or the compiler will
complain. (it'll also complain if you use a "real" Public Property Foo
As Integer, BTW!)
* Note that I use the word 'virtual' here not in the normal OOP sense,
but as the antonym of 'real'.
On May 2, 2006, at 11:52 AM, Maarten de Vries wrote:
Hi,
Is it possible to add properties to a class interface? The add property
button was grayed out (2005R4) so I guess it's not possible, but it
would be
handy...
Maarten
_______________________________________________
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>
William H Squires Jr
4400 Horizon Hill #4006
San Antonio, TX 78229
[EMAIL PROTECTED] <- remove the .nospam
_______________________________________________
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>