[R] Need Help with R.oo and "multiple inheritance"
Ken-JP
kfmfe04 at gmail.com
Sat Apr 18 08:49:36 CEST 2009
This is what I'm trying to do:
HasPersistence - an Interface class which implements things like
WriteToDisk(), ReadFromDisk()
B isA A
C isA A, but also implements HasPersistence
My solution in R.oo is to have a root class called A which implements
IsPersistent() by returning FALSE, but is overrideable by C to return TRUE.
C will also implement WriteToDisk() and ReadFromDisk(). This solution will
work, but is kludgy, because it is not directly obvious that IsPersistent(),
WriteToDisk(), and ReadFromDisk() go together in a conceptual
HasPersistence.
Is there a more R.oo-clean-way of multiply inheriting like this, so if
someone else reads my code, the concept of HasPersistence is more obvious?
In other words, could I actually have a HasPersistence class and have C
inherit from A and implement HasPersistence also?
- Ken
--
View this message in context: http://www.nabble.com/Need-Help-with-R.oo-and-%22multiple-inheritance%22-tp23109913p23109913.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list