home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19726 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1.6 KB

  1. Path: sparky!uunet!mcsun!sunic!corax.udac.uu.se!buzz.bmc.uu.se!perrier!sundvall
  2. From: sundvall@perrier.embnet.se (Mats Sundvall)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Maximum reusability, was: C++ ..tree Inheritance ..
  5. Date: 21 Jan 1993 09:45:45 GMT
  6. Organization: EMBNet Project Sweden
  7. Lines: 39
  8. Distribution: world
  9. Message-ID: <1jlrc9INNq5m@buzz.bmc.uu.se>
  10. References: <1993Jan19.190743.1689@ucc.su.OZ.AU>
  11. Reply-To: sundvall@perrier.embnet.se
  12. NNTP-Posting-Host: perrier.embnet.se
  13.  
  14.  
  15. In article 1689@ucc.su.OZ.AU, maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  16.  
  17. >It is best in modular design to MINIMISE inheritance. It is 
  18. >in general not a good thing. Although it supports reusability,
  19. >it does so with strong coupling (BAD) and without
  20. >explicit interfaces (BAD).
  21. >
  22. >Huge single inheritance heirarchies are the worst kind.
  23. >
  24. >Try using mixins. Lots of small independent abstracts,
  25. >some common syntheses of these abstractions,
  26. >and some common implementations of these abstractions.
  27. >
  28. >Also supply routines operating on the abstractions.
  29. >These will work what ever the implementation chosen
  30. >is, whether it be from the library or supplied
  31. >by the user.
  32. >
  33.  
  34.  
  35.  
  36. I am not arguing about mixins but a problem I often encounter is when you need the
  37. same functionality in most or all of your classes. One example would be object I/O
  38. like in OODB's or if you want to stream objects to a file or across the net.
  39.  
  40.  
  41. The methods you need will end up in the mixin Object or PersBase or whatever you
  42. call it and voila, you have a huge tree.
  43.  
  44.  
  45. Please prove that I am wrong, I don't like it either!
  46.  
  47.  
  48. Mats Sundvall
  49.  
  50. Uppsala University
  51. Sweden
  52.  
  53.