Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!bu.edu!wang!bu-tyng!three!cory From: cory@three.mv.com (Cory Kempf) Newsgroups: comp.object Subject: Re: object-oriented design is *hard*! Keywords: object-oriented design OOD Message-ID: <469@three.mv.com> Date: 10 Sep 90 01:36:04 GMT References: <1264@mtunq.ATT.COM> Organization: EnigamI, Nashua, NH. Lines: 64 psrc@mtunq.att.com (Paul S. R. Chisholm) writes: >But I'm *really* struggling with object-oriented design! >I've *finally* become very comfortable with the top-down approach; > Managing the intellectual process is very >straightforward. The top down approach is nice for proceedural programming, but it is probably not the best for OOP. I have found that a bottom up method works better... Start out by identifying the objects. Figure out what properties they have, what messages they should receive, and how they should act. For example, a window might want idle time messages, mouse down messages, update messages, keydown messages, etc. Now look at all of those objects. Find objects that have things in common -- similar properties, similar messages, or similar actions. Often, you will notice that a certain object will need to be broken up into two or three subobjects, and others can be combined into a superobject. Keep working at this, and you will have an inheritance tree (several, usually). At the same time, you should be doing your containment tree. >OOD is different. I seem to need to keep everything in my head, design >everything, and only then start coding. This is quite true. Only I would add that after you start coding, you will find that you want to twiddle the design some more. This is, in general, good. > The only way I could get far >enough to come up with an object-oriented design is do the bulk of a >top-down design, and then notice the common elements! Even so, I don't >really know where to start, or what the natural next steps are when >I've finished one step. If you start with a top down proceedural approach, you will only be making more work for yourself, and will most likely not have a truly object oriented design. OOD is a different methodology. In general, you first need to identify the objects, then find commonality. Often I find that a CAD system helps. In fact, the wall of my office has two great big pictures (6 pages (reduced 50%) and 20 pages) of the design of my current project... I don't think that I could have seen the inheritance with out the CAD program. (I still need to do another week or two worth of design: I stopped to test key parts for feasability now I need to redesign a bit -- much better than re-coding) >Anybody else experiencing this, or should I apply for a job flipping >hamburgers at McDonalds? If you can handle looking at the world from a different direction, you shouldn't have too much trouble. Otherwise, I would suggest avoiding closing -- it is a real pain. :-) +C -- Cory Kempf I do speak for the company (sometimes). The EnigamI Co. 603 883 2474 email: cory@three.mv.com, harvard!zinn!three!cory