I would like to write an interface class and use it as follows
public Interface IFunction
property name as string
end interface
public class ModelFunction
implements IFunction
public property name as string
public sub new()
end class
* EDIT (deleted the following sentence for being noob, thanks @damien_the_unbeliever for pointing this out): But this cannot be done because the property in the vb.net interface should be read-only or writeonly (as far as I can get it) *
Now I wrote this, but it seems a bit wrong:
public Interface IFunction
Readlonly property getName() as string
writeonly property writeName() as string
end interface
public class ModelFunction
implements IFunction
....
end class
Does anyone have a better solution for this? or can help me with properties in an interface class. Read some articles here about stackoverflow, but none of them pointed me in the right direction.
source
share