Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!porpoise.cis.ufl.edu!bp From: bp@porpoise.cis.ufl.edu (Brian Pane) Newsgroups: comp.lang.c++ Subject: Re: C++, Object Design Methodologies and Software Engineering Message-ID: <25248@uflorida.cis.ufl.EDU> Date: 4 Nov 90 23:07:03 GMT References: <24872@uflorida.cis.ufl.EDU> <2390@lupine.NCD.COM> <12823@cadillac.CAD.MCC.COM> Sender: news@uflorida.cis.ufl.EDU Reply-To: bp@porpoise.cis.ufl.edu (Brian Pane) Organization: U of Florida. Computer Science Dept. Lines: 57 In article <12823@cadillac.CAD.MCC.COM>, vaughan@mcc.com (Paul Vaughan) writes: | | From: rfg@NCD.COM (Ron Guilmette) | | A related question was discussed awhile back, i.e. the question of | why C++ can't be a bit more like Ada. ^^^^^^^^^^^ aaargh! ^^^^^^^^^^^^^^^^ | | Specifically, I think that the kind of thing that you are perhaps | looking for might be a header file that looks kinda like this: | | class car; | | car::car (int cost); | car::~car (); | heading car::turn (direction d); | next_date car::change_oil (station s); | | In other words, a sort of *abbreviated* description of the interface to | a class which is provided to some user of the class. | | Allowing abbreviated descriptions like this (which leave out information | about data members) could potentially cut down dramatically on the | amount of recompilations we have to do over the lifetime of a class. | | I hope that the ANSI committee will consider this possible solution | for an important (and as yet unresolved) problem. | . . . | |I've suggested this sort of thing for different reasons before, but it |hasn't sparked any enthusiasm. I proposed that this sort of |declaration would help to solve severe modularity problems. That sort of abbreviated class description seems like a very good approach for leaf classes. However, you still need the full declaration in order to derive child classes. IMHO, such a syntax would only make it harder to get any work done; maintaining consistency among the full class declaration, the abbreviated declaration, and the member implementations would require extra software engineering work. Actually, I suppose you could achieve the same result by writing a filter that read the class declaration and wrote out a version containing only the function prototypes, not the data members. This filtered file could be included by files which needed only to call the class's member functions, and the original could be included by files implementing derived functions. You could maintain declaration coherency by writing a makefile rule which regenerated the filtered file when the original header file was modified, perhaps. How does this approach sound? | Paul Vaughan, MCC CAD Program | ARPA: vaughan@mcc.com | Phone: [512] 338-3639 | Box 200195, Austin, TX 78720 | UUCP: ...!cs.utexas.edu!milano!cadillac!vaughan ------------------------------------------------------------------------- Brian_Pane::~Brian_Pane() { "bp@swamp.cis.ufl.edu"; } // University of Florida Department of Computer Science Class of 1991 -------------------------------------------------------------------------