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

  1. Xref: sparky comp.lang.c++:20002 comp.object:5083
  2. Newsgroups: comp.lang.c++,comp.object
  3. Path: sparky!uunet!charon.amdahl.com!amdahl!rtech!pacbell.com!ames!elroy.jpl.nasa.gov!sdd.hp.com!swrinde!emory!gatech!rpi!batcomputer!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
  4. From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
  5. Subject: Re: Pros and cons of C++
  6. Message-ID: <1993Jan27.201838.20385@ucc.su.OZ.AU>
  7. Sender: news@ucc.su.OZ.AU
  8. Nntp-Posting-Host: extro.ucc.su.oz.au
  9. Organization: MAXTAL P/L C/- University Computing Centre, Sydney
  10. References: <1993Jan13.215141.14487@informix.com> <TMB.93Jan14144656@arolla.idiap.ch> <C1G9H4.HsA@unix.portal.com>
  11. Date: Wed, 27 Jan 1993 20:18:38 GMT
  12. Lines: 52
  13.  
  14. In article <C1G9H4.HsA@unix.portal.com> samantha@shell.portal.com (Samantha Atkins) writes:
  15. >Only in that the type understands the message.  OK.  So if I want to get
  16. >the maximum flexibility I would probably tend to factor my class hierarchy
  17. >very highly with lots and lots of mix-in classes for every reasonable 
  18. >set of behaviors.  
  19.  
  20.     Not every reasonable set: just some basic and fairly
  21. independent sets to form the 'Axioms', and some common combinations
  22. with additional computed functions : 'Theorems'.
  23.  
  24. >Then for working classes I would mix and match to 
  25. >produce just what I need.  
  26.  
  27.     For your working Objects: each object a different mixin class
  28. if you need.
  29.  
  30. >Here we run into some sticky situations in that
  31. >not only would I need all these little mixins but I would also quite likely
  32. >need various equally abstract classes that represent various combinations
  33. >of them as my typing of say, parameters, is only class based and I want to
  34. >leave maximum flexibility and reuse in.  Now it seems pretty obvious to me
  35. >that over time I'm going to want to change this around or add more combinations
  36. >as I can't just declare the whole exponential mess right the first time.  
  37. >Also we would have to contend with the unpleasant fact that all this churning
  38. >through this exponentially growing hierarchy takes real CPU time and resources
  39. >that eventually will get very seriously strained.
  40.  
  41.     I think its the other way around. WITHOUT mixins you have to
  42. declare a whole lot of different classes to do what you might
  43. want. 
  44.  
  45.     WITH mixins you only need to declare the sorts of interfaces
  46. you need at in the current program. The basic library functions
  47. operate on the abstract bases of these classes.
  48. >
  49. >Am I going askew here or is it as it seems to me that so called strong typing
  50. >creates an untenable mess if you seriously attempt its use now and for the
  51. >future?
  52.  
  53.     Class based strong typing does have the disadvantage
  54. that you have to make a class for every object, you cant just
  55. make up the methods you need as you need them.
  56.  
  57.     Mixins are a sort of compromise between the two approaches:
  58. use classes, but keep them small and independent. Get flexible
  59. object construction AND strong typing.
  60.  
  61. -- 
  62. ;----------------------------------------------------------------------
  63.         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  64.     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  65. ;------ SCIENTIFIC AND ENGINEERING SOFTWARE ---ph:  2 799 8223 --------
  66.