From: Braden M. <br...@en...> - 2005-11-20 05:51:47
|
On Sat, 2005-11-19 at 16:25 -0500, Reed Hedges wrote: > I looked at node_class a bit but don't remember exactly how it works, > but "factory" does imply a specific way of operating. Could a > node_metatype in fact be a kind of node_type? Then you could just have > "nothing but node_types all the way down" :) A node_class is a factory for node_types. node_class and node_type have distinct roles. A node_type identifies a subset of the interfaces that can be supported by a node implementation and is a factory for nodes that have those interfaces. The node_class gives the node implementation identity and provides a way of creating node_types. Different node types can share implementation logic--that's not unique to OpenVRML; that's just the way VRML97 works. node_class is a place to hang that shared implementation logic. > Either way, but yes, I did find the whole idea of node_class a bit > mysterious at first, partly because I didn't know what _class meant. I agree it's vague. So is _metatype better? If not, then what? > Most of us openvrml users won't need to deal with node_class anyway if > we're not creating new types of nodes, right? So the documentation > could just say so and we could skip over it. That's true to an extent; though API changes that will be going in soon will raise its visibility a bit: I'll be making it possible to add and retrieve node_classes to/from a browser instance. Most casual users probably won't be interested in this functionality; but it does expose a rather important dimension of flexibility to those who need it. -- Braden McDaniel e-mail: <br...@en...> <http://endoframe.com> Jabber: <br...@ja...> |