home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16366 < prev    next >
Encoding:
Internet Message Format  |  1992-11-16  |  1.8 KB

  1. Path: sparky!uunet!ukma!wupost!usc!news!nic.cerf.net!hlf
  2. From: hlf@nic.cerf.net (Howard Ferguson)
  3. Newsgroups: comp.lang.c++
  4. Subject: Should I use a generic object which all others inherit from
  5. Message-ID: <3762@news.cerf.net>
  6. Date: 16 Nov 92 16:38:04 GMT
  7. Sender: news@news.cerf.net
  8. Organization: CERFnet
  9. Lines: 34
  10. Nntp-Posting-Host: nic.cerf.net
  11.  
  12. I am working on the early stages of design on an embedded C++
  13. project. One of the decisions which we will have to make in the
  14. near future is whether to make all of the objects inherit from 
  15. onie generic object at the top of the tree or to go for the forest 
  16. approach. 
  17.  
  18. I realise that the tree style will make certain  garbage collection 
  19. methods easier, but hopefully we are going to be able to create 
  20. everything at start-up time and never destroy them (except
  21. for objects with scope local to one function). The only other
  22. advantage of the generic object approach as far as I can see is
  23. that it make hetrogenous lists easier to manage, but since all
  24. of our type checking is gone, are we as well off using void *'s.
  25.  
  26. The NIH class library encourages the generic object approach, as
  27. does COOL, but USL allows the forest approach. Since we have  
  28. not decided which library of standard objects to use, that decision
  29. will be heavily influenced by our decision on whether to go for
  30. the tree or forest approach.
  31.  
  32. Do any of you netters have any hard-and-fast rules about when
  33. to go for the tree and when to go for the forest aproach.
  34. Is there a big performance price top be paid for the tree approach.
  35. Does the tree have other advantages which I have not noted???
  36.  
  37. Bear in mind that this software must be very reliable and any
  38. factors which effect this are very important to us. How much 
  39. type checking are we really losing by going for a generic approach??
  40.  
  41.  
  42.         Many thanks,
  43.             hlf
  44.  
  45.  
  46.