Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uakari.primate.wisc.edu!indri!ames!uhccux!munnari.oz.au!murtoa.cs.mu.oz.au!otc.otca.oz.au!gregw From: gregw@otc.otca.oz.au (Greg Wilkins) Newsgroups: comp.lang.c++ Subject: Re: Objectifying incoming messages? Keywords: Messages Message-ID: <828@otc.otca.oz> Date: 22 Aug 89 03:54:50 GMT References: <452@cimshop.UUCP> <444@cimshop.UUCP> Sender: news@otc.otca.oz Lines: 28 davidm@cimshop.UUCP (David Masterson) writes: > However, in C++, its not a good idea for a constructor function to >return before the reply (and, therefore, the data) has been received. Thus >the C++ program is hung. So, my question is what is the appropriate C++ >fashion for constructing an object when the object construction may involve >sending a message and getting a reply that you don't want to wait for? The problem of Objectifying incoming messages is a very large complex problem. However I think you have invented an extra problem for yourself. If you cannot completely construct an object until a message is sent and a reply recieved, then I see the the solution is to construct a base class, this bass class then sends the message to find out which particular specialization it is and coerces itself to a derived class when it recieves the reply. As I said before, I dont think this is the main issue with Objectifying incoming messages. The main problem is coming up with a general method for inserting/extracting type information without big case statements. The central type server (to which you send a querry and recieve your type in reply) may be one solution, but it appears that all it is achieving is moving the case statement somewhere else and ignoring the problem of placement of explicit type information. gregw@otc.oz