Re: Flaw in the driver-model implementation of attributes

From: viro@parcelfarce.linux.theplanet.co.uk
Date: Tue Jun 17 2003 - 23:18:11 EST


On Tue, Jun 17, 2003 at 08:44:50PM -0700, Perez-Gonzalez, Inaky wrote:

> Maybe this is going to kill my argument as an analogy, but think
> about a C++ class hierarchy, where belonging to a class means
> to inherit that class' methods. When an object is instantiated
> and its class inherits a lot of other classes, it inherits all
> the methods of those classes. Your methods are the attrs, and
> you can access them with the same pointer, you don't need to
> look somewhere else ...

But there is no inheritance here. Block device and IDE disk are
different objects and relation is not "A is B with <...>", it's
"among other things, A happens to use B in a way <...>".

Moreover, there is no such thing as "physical device of that block device".
There might be many. There might be none. IOW, we have a bunch of
constructors for class "block device" and some of them happen to have
some kinds of physical devices among their arguments. That's it.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jun 23 2003 - 22:00:23 EST