Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!hc!lll-winken!uunet!cimshop!davidm From: davidm@cimshop.UUCP (David Masterson) Newsgroups: comp.lang.c++ Subject: Objectifying incoming messages? Summary: General to specific object types Message-ID: <444@cimshop.UUCP> Date: 26 Jul 89 17:17:08 GMT Organization: Consilium Mt. View CA Lines: 21 I'm working in an area doing C++ development that has several processes communicating with one another. The messages shipped back and forth tend to be asynchronous, so a receiving process cannot know what the message is or who it came from until it looks at the message data. My question is this: What is the appropriate method of taking a generic object (Message) and turning it into an object of the type that is embedded in the message (say, Employee)? Should this be done through virtual functions and subclassing of the Message object? Or is it more appropriate to have the Message object look at itself and construct an object of the appropriate type (perhaps some sort of array of pointers to object constructors)? The fundamental question hinges around the lack of context of the incoming message. Therefore, the message user must look at the data in order to determine what to coerce (definition?) the message into. Is this appropriate or is there a better way? aTdHvAaNnKcSe David Masterson uunet!cimshop!davidm or DMasterson@cup.portal.com