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: Hey Bjarne! Some Questions Message-ID: <1271@devvax.JPL.NASA.GOV> Date: 9 Feb 88 19:52:20 GMT Sender: news@devvax.JPL.NASA.GOV Reply-To: des@jplpro.JPL.NASA.GOV (David Smyth) Organization: Jet Propulsion Laboratory, Pasadena CA. Lines: 77 Summary: OOD and C++ questions References: Bjarne is coming to give a talk on C++ here at JPL on Friday the 12th, and we get to grill him first in a round table discussion. Here are a few questions I will be asking. I hope this gives Bjarne some warning, and I hope everybody on the net can also discuss these issues rationally (am I dreaming? ;^) 1) Exception Handling in C++ a) How does/will it work? b) What are the strengths and weaknesses of this approach? 2) OO Design Tools a) Are there any? It seems that it has taken about 15 years now for decent structured design tools to become available, but now structured design is OBVIOUSLY obsolete ;^) Will it take 15 years this time too? (I am NOT talking about OO PROGRAMMING tools, but OO DESIGN tools) b) What should such tools be like? How would they work, what would they do? What are the hardest problems in OOD which should be automated or supported byu such tools? 3) The problem with (single) inheritance: Change the objects .vs. change the tools. For example, in several articles and the book by Brad Cox, he demonstrates how a new class of object can be manipulated by an existing tool without changing the tool, just adding the new class definition for the object. His example is a pencil cup which can really hold just about anything. A method supported by the pencil cup is compute the weight of all items in the pencil cup. In the "old fashioned" solution, there would be a case statement with a case for each type ot item which could be held by the cup. If a new class is to be supported, the case statement must be altered to include a case for the new item. In the new fangled OO approach, we just always ask the object for its weight, and Presto! Chango! we don't have to change *anything* to support the new object. Gosh, that is wonderful. It takes only a few microseconds to notice the dirt which is being swept under the carpet ... What this example REALLY shows is how OO systems can distribute the responsibility for how a tool behaves from the tool maker to the object developers. Each object must have all methods which may be required by all tools in the system. Now when a tool is added, all objects must change. See, the dirt is still there! I think that multiple inheritance is a reasonable solution to preventing this distribution of responsibility. The tool implementor would also implement a class which is manipulated by the tool. All objects which can be manipulated then inherit the methods from this new class. Flavors works something like this with mix-ins. So the questions are: a) Will C++ support multiple inheritance? b) Given the existing lack of this capability, how does one effect the same concentration of responsibility within a project requiring a large number of tools? 4) Complex Algorithms Object oriented design maps well into problem domains with a large number of complex objects, but where the algorithm describing the interactions of objects is simple. For example, say you are simulating a football team. The players are naturally identified as objects. But what about the game plan? This plan is very complex. How is the plan itself broken down into objects, given the possibly extensive context dependancies of various options within the game plan? "Pass if this and that and the other...." Note that structured design also falls down on complex context dependancies. How does OOD help? Anybody on the net with comments, please post them! I do not think these are simple problems, and I do not think there is exactly one sloution. I do want to see what Bjarne thinks about them and how C++ supports the solution of these problems. I also want to see how the net at large grapples with these problems. Comment one and all!