home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- From: nikki@trmphrst.demon.co.uk (Nikki Locke)
- Path: sparky!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
- Distribution: world
- Subject: Re: Covariant Types in Derived Classes
- References: <1MH5C0K@netmbx.netmbx.de>
- X-Mailer: cppnews $Revision: 1.10 $
- Organization: Trumphurst Ltd.
- Lines: 50
- Date: Mon, 27 Jul 1992 20:55:45 +0000
- Message-ID: <712295745snx@trmphrst.demon.co.uk>
- Sender: usenet@gate.demon.co.uk
-
-
- In article <1MH5C0K@netmbx.netmbx.de> jrobie@netmbx.netmbx.de (Jonathan Robie) writes:
-
- > nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
- >
- > >The report generator and the user interface tool does not _require_ RTTI.
- > >The objects to be displayed/reported on should return a Collection of field
- > >specifiers from a virtual function. These field specifiers can then be
- > >placed on a menu for user selection and placement. The field specifier
- > >will contain virtual functions to format, display, validate and set the
- > >value of each field. A generic user interface object can then be
- > >constructed to use these methods for displaying and/or editing the field.
- >
- > Now for the key question: where does this Collection of field specifiers
- > come from? Are you implying that the *user* needs to code all this? It
- > should not be available to a general library class?
- The user (by which I take it you mean programmer) would probably code this
- by using predefined classes for such things as string and simple numeric
- fields, and deriving from these classes where the field is complicated.
-
- >
- > Why not allow default display using exactly the same information used by
- > the debugger?
- So, as I understand it, you want some kind of RTTI which enables you to
- determine not only the type (class) of any object, but also details of
- every public and private variable and implementation details within the
- class. Can this really be true ? If it is, you don't want C++ :-) I must
- be mis-interpreting, surely.
-
- > The alternative is to require a programming strategy like this:
- >
- > 1. Design the class you need
- > 2. Write code to print objects of this class
- > 3. Write code to store objects of this class in a database
- > 4. Write code to display objects of this class
- > 5. Write code to input and edit objects of this class
- >
- > We all agree that reliable code is our goal. General purpose tools
- > which can largely automate steps 2-5 will greatly reduce the amount
- > of code that needs to be written for each class.
- Fine - but these general purpose tools should be code generators, not
- sufficient RTTI to enable any hack programmer to totally subvert the type
- system, encapsulation, data hiding and just about everything else that's
- good about OOPL's.
- ---
- Nikki Locke | | nikki@trmphrst.demon.co.uk
- Trumphurst Ltd. | Tel: +44 (0)691-670318 | nikki@cix.compulink.co.uk
- PC and Unix consultancy | Fax: +44 (0)691-670316 | nikki@kewill.co.uk
- trmphrst.demon.co.uk is NOT connected with ANY other sites at demon.co.uk.
- Demon.co.uk is a dial-up subscription access point to the Internet.
-