home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11594 < prev    next >
Encoding:
Text File  |  1992-07-26  |  2.4 KB  |  66 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!netmbx!jrobie
  3. From: jrobie@netmbx.netmbx.de (Jonathan Robie)
  4. Subject: Re: Covariant Types in Derived Classes
  5. Organization: netmbx, Berlin, Germany
  6. Date: Mon, 27 Jul 1992 08:22:59 GMT
  7. Message-ID: <1MH5C0K@netmbx.netmbx.de>
  8. References: <VKE52M@netmbx.netmbx.de> <712030928snx@trmphrst.demon.co.uk>
  9. Lines: 55
  10.  
  11. nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
  12.  
  13. >> Not so.  A report generator might start by showing me the default
  14. >> printout for an object.  I can grab fields with my mouse and move
  15. >> them around or delete them.
  16. >> 
  17. >> A user interface tool might allow me to do something similar by providing
  18. >> me with a default, editable window.
  19. >> 
  20. >The report generator and the user interface tool does not _require_ RTTI. 
  21. >The objects to be displayed/reported on should return a Collection of field 
  22. >specifiers from a virtual function. These field specifiers can then be 
  23. >placed on a menu for user selection and placement. The field specifier 
  24. >will contain virtual functions to format, display, validate and set the 
  25. >value of each field. A generic user interface object can then be 
  26. >constructed to use these methods for displaying and/or editing the field.
  27.  
  28. Now for the key question: where does this Collection of field specifiers
  29. come from?  Are you implying that the *user* needs to code all this?  It
  30. should not be available to a general library class?
  31.  
  32. Why not allow default display using exactly the same information used by
  33. the debugger?
  34.  
  35. The alternative is to require a programming strategy like this:
  36.  
  37.     1.  Design the class you need
  38.     2.  Write code to print objects of this class
  39.     3.  Write code to store objects of this class in a database
  40.     4.  Write code to display objects of this class
  41.     5.  Write code to input and edit objects of this class
  42.  
  43. We all agree that reliable code is our goal.  General purpose tools
  44. which can largely automate steps 2-5 will greatly reduce the amount
  45. of code that needs to be written for each class.
  46.  
  47. It is just possible that some of this code contains errors.
  48.  
  49.  
  50. Jonathan
  51.  
  52. ===========================================================================
  53.  
  54. Jonathan Robie        jrobie@netmbx.UUCP
  55. Arnold-Zweig-Str. 44    jrobie@netmbx.in-berlin.de
  56. O-1100 Berlin        
  57. Deutschland        Phone:  +37 (2) 472 04 19  (Home, East Berlin)
  58.                 +49 (30) 342 30 66 (Work, West Berlin)
  59.  
  60.  
  61. -- 
  62. Jonathan
  63.  
  64. ===========================================================================
  65.  
  66.