[Prev][Next][Index][Thread]

methods on make



Would a better example have been reading in a set of UI widgets from a
stream? 

- Call make on the superclass of all the widgets with the stream as an
initarg.
- Read the tag identifying the concrete class from the stream.
- Dispatch to the appropriate make for the concrete class, again passing
the stream.
- Return the actual type to the client code, which does not have to downcast.

That gets rid of the nasty downcast in C++ code for this kind of thing.
But maybe there's a better way in Dylan to address the other issues as well?


Scott Ribe
scott_ribe@killerbytes.com
http://www.killerbytes.com/
(303) 665-7007 voice



Follow-Ups: