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.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to