Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!elroy!devvax!jplpro!des From: des@jplpro.JPL.NASA.GOV (David Smyth) Newsgroups: comp.lang.c++ Subject: Re: Object Design Tools Message-ID: <1542@devvax.JPL.NASA.GOV> Date: 11 Mar 88 19:54:36 GMT References: <97@cui.UUCP> <36300003@pyr1.cs.ucl.ac.uk> <1442@devvax.JPL.NASA.GOV> <1681@stpstn.UUCP> Sender: news@devvax.JPL.NASA.GOV Reply-To: des@jplpro.JPL.NASA.GOV (David Smyth) Organization: Jet Propulsion Laboratory, Pasadena CA. Lines: 46 cox@stpstn.UUCP (Brad Cox) writes: >>des@jplpro.JPL.NASA.GOV (David Smyth) writes: >> OOD Methodology (derived from Booch, Cox, and MANY others): >> 1) Understand the problem any way you want to... >> 2) Write an informal description of the problem... >> 3) Identify the "objects" (nouns, ... >> 4) Identify the attributes of the objects (descriptive prose) and the >> methods applied to the objects (active prose). > > ... avoid what I now refer to (after having >*recommended* it several times in writing! That is, before I knew better) >as a sucker trap that object-oriented programming lays for the unwary, > > OBJECTS SHOULD NEVER KNOW HOW TO `PRINT' THEMSELVES > (or `display' themselves, nor any analogous verb). > >Printing is guaranteed to change because it depends on display device >technology, formatting requirements, and even the needs/expertise of the >viewer, while abstract (model) objects can live on and on without change. I think this is really a good place to use multiple inheritance, or an underlying layer (resource class) used by objects. The "print" method requires context. This can be presumed by inherited attributes and methods which know about the context: Print_self! for a memo being mailed (showing up in a mailbox contents display) would be different than the Print_self! method required by a browser, perhaps. The mailbox and browser developers can define the required methods and attributes, and a memo class, say, which is to interact with the mailbox or browser can inherit from those classes, and modify them to fit the memo class. In a sense, the "browser object" class as inherited by "memo class" simply specifies the interface - both process and data - that browser requires. Browser would ask a memo to "Print_self!" and the memo would do so. True, the code and data would likely come from the Browser developer. The memo developer can tailor as required. --------------- OOD is NOT a panacea, or a cookbook for good design. I do not think there IS a cookbook for good design. Good designers approach problems in different ways. I know I design differently than, say, my brother, and both of us have been sucessful in our designs. As you (B.Cox) said, "USE THE BEST TOOL FOR THE JOB" but I think this should be added: "GET THE BEST DESIGNERS AVAILABLE" as the tools won't solve the problem, rather a good designer using good tools will solve the problem.