Whether you are programming in C, C++, C Sharp, Java, Able, or Ada, you need some method to your madness. In the late 1970s and early 1980s there was much talk about structured system and software design — conceived by Dijkstra and developed by Tom DeMarco, Ken Orr, Larry Constantine, Vaughn Frick, Ed Yourdon, Steven Ward, and others.
I still think this is worthwhile today.
One ancient article I have turned to many times is A Guided Tour of Program Design Methodologies published in IEEE Computer, October 1981 (http://tinyurl.com/4zk9nsa). The article succinctly lays out the concepts of component decomposition, abstraction, cohesion, coupling, and complexity. A few of the main concepts:
Component decomposition
• Divide and conquer.
• Intellectual manageability.
• Facilitate change and reuse.
The characteristics of a good decomposition
• Cohesion: the artifacts grouped together in a component should have strong intrarelationships and should be together.
• Coupling: the interaction and inter-relationships between different components should be minimized.
Examples of cohesion and coupling
One component with everything in it:
• Bad cohesion (probably contains weakly related elements).
• Good coupling (intercomponent relationships are weak or not at all).
Every part of a program in its own component:
• Good cohesion (all intracomponent relationships are strong, as there are none)
• Bad coupling (things that should be together in the same component are separated)
Designs balance the goal of high cohesion against the goal of low coupling and provide greatly reduced software errors, and greatly improved readability and portability.
Some references:
Tom DeMarco, Structured Analysis and Systems Specification . New York: YOURDON Press, 1978.
Ken Orr, Structured Systems Development . New York: Yourdon Press, 1977.
Paul Ward and Steve Mellor, Structured Development for Real-Time Systems , Volumes 1–3. New York: Yourdon Press, 1985.
Edward Yourdon and Larry L. Constantine, Structured Design: Fundamentals of a Discipline of Computer Program and Systems Design . Englewood Cliffs, N.J.: Prentice-Hall, 1989.
Yes, I know they are really old, but that’s why I’m pointing them out — because they are still valid and interesting.
Of course, object-oriented programming (using data structures consisting of data fields and methods together with their interactions) is a key feature of most designs today.
Another prominent design tool these days is UML (Unified Modeling Language), which can provide a basis for model-driven development.
The underlying premise of UML is that no one diagram can capture the different elements of a system in its entirety. UML is then made up of nine diagrams that can be used to model a system at different points of time in the software life cycle of a system (see www.uml.org).
There are a ton of UML editors available, some of which are free. If you have a recommendation (or antirecommendation) for one of these tools, please email me (jpharrison@hearst.com). Please tell me why you like it (or not). I would like to make a list to post on EEBeat.com. Here are a few suppliers:
• IBM Rational supplies a UML package called Rose Data Modeler, and it comes in a real-time version for C and C++. And, Green Hills Software provides a version of Rational Rose for use with its MULTI IDE package.
• Altova UModel can generate Java, C Sharp, or Visual Basic .NET code.
• Mentor Graphics has BridgePoint — an advanced UML-based environment that is said to enable getting real-time embedded applications right the first time.
Advertisement
Learn more about Electronic Products Magazine