Re: Inheritance (Is this the consensus??)

Park SungWoo (gladius@compiler.kaist.ac.kr)
Tue, 15 Apr 1997 04:30:08 +0900 (KST)

> I think, the second example is just a different way to
> write the first. But the first example is how you
> define a PROTO, it's just that the inheritance hierarchy,
> that Robot is a subclass of Transform is not exploited
> for a type system in VRML 2.0 and that the properties
> (fields and events) of Transform are not automatically
> added to those of Robot. *This latter point is very important !!!*

-> Yes, it's very important.

> So we could drop the EXTENDS keyword,
> replace PROTO by CLASS and allow interfaces
> (IMPLEMENTS). An interface is defined like a PROTO,
> but does not have a body:
>
> INTERFACE Clock [ eventIn TimeSensor tick ].
> INTERFACE Mover [ eventIn SFFloat move ].
> INTERFACE Animator [ eventIn SFBoolean start ] EXTENDS Clock, Mover.
> INTERFACE Talker [ eventIn SFString talk ].
>
> CLASS MyRobot IMPLEMENTS Animator, Talker [ ... ]
> { Robot { ... }
> ...
> }
>
> What do you think of this solution, I think it's intuitive,
> easy to implement and very effective.

I agree. I think it is a good solution.
You did state implicitly that these INTERFACEs are only related with
eventIns, didn't you ? That is, I think that in INTERFACEs, there should
be no fields, exposedFields, or eventOuts. Is my idea right ?

Thanks.

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 Sungwoo Park, (Castle-Help Naive)
	homepage : http://compiler.kaist.ac.kr/~gladius
 	e-mail : gladius@compiler.kaist.ac.kr
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -