Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!wuarchive!uunet!mcsun!hp4nl!targon!ruud From: ruud@targon.UUCP (Ruud Harmsen) Newsgroups: comp.lang.c++ Subject: Re: object-oriented design (was Re: are 'friend's really necessary ??) Message-ID: <1115@targon.UUCP> Date: 5 Apr 90 10:16:28 GMT References: <169@pollux.kulcs.uucp> <10589@alice.UUCP> <1082@targon.UUCP> <1110@targon.UUCP> <4593@pegasus.ATT.COM> Reply-To: ruud@targon.UUCP (Ruud Harmsen) Organization: Nixdorf Computer BV., SWP, P.O. Box 29,Vianen, The Netherlands Lines: 31 In article <4593@pegasus.ATT.COM> psrc@pegasus.ATT.COM (Paul S. R. Chisholm) writes: >> In theory, this is correct. But if in practice, in a particular >> application 70 to 80 percent *has* to mess with a class A, then you can't >> do very much limiting. > I wrote: >Exactly right. That's the signature of a poor design. You have to >*try*, hard, to hide the implementation of your data types. Twenty >years of programming have taught me that it's worth the effort. Lots >of other believe it, too. Perhaps it all depends a lot on the kind of application. In the ones I dealt with most (financial accounting, invoicing, banking etc.) the implementation of the data types, say the fields of the structs, are exactly what the *user* of the system deals with, viz. enters, browses, prints, talks about with his clients, etc. How could it be useful to *hide* these things, if to the *user* of the system, they are the only things that matter? If you hide the data-items, nothing useful remains. I can imagine that in other sorts of applications, perhaps an operating system, or a graphics system, this is quite different. For example, the UNIX implementation of buffered IO is built in an OO-fashion, and I am very content that I don't have to know what exactly hides behind the type FILE, to be able to use it. But now tell a bookkeeper he doesn't need to know what data items are in the system about his debtors! So maybe that's why we may well be both right, and simply talking ahead of each other, because we simply don't have the same kind of systems in mind?