Case Study: A-7E Project

13 December 2021 by Phillip JohnstonIn the mid-1970s, the Naval Research Laboratory (NRL) in Washington, D.C. launched a project to redesign the flight software the A-7E aircraft using the latest in computer science research and technology being developed in academia and laboratories. The purpose was to create a convincing demonstration of the value of these techniques in real-world applications. The original A-7 aircraft was considered a successful program because it worked reliably. However, it was expensive to maintain due to common software problems: it barely met its time and space limitations it was not fully understood by the maintenance personnel …

To access this content, you must purchase a Membership - check out the different options here. If you're a member, log in.

Design Concept Violations Lead to Software Aging

6 December 2021 by Phillip JohnstonAll software will age, and in order to prevent aging one must update the software. Unfortunately, updates can lead to aging as well. Design concept violations are one of the causes of software aging. The design concepts can take many forms, such as where different pieces of the project belong, which components are responsible for which activities, or the underlying goals of each interface. If you’re successful, the typical pattern is that the original creators move on to different projects and their successors take over management. This is where the problem starts: Changes are made …

To access this content, you must purchase a Membership - check out the different options here. If you're a member, log in.

Problem Domain Context Model

16 November 2021 by Phillip JohnstonA Problem Domain Context Model is a type of system context model that is used to explore the problem space and environment for the system to be developed. Purpose This model is used to explore the problem domain and identify various real-world and information structural elements that are included in the problem domain. Relationships between different elements in the problem domain are also explored. The goal is to create conceptual static model which includes relevant systems, users, physical entities, and information entities Note A Rich Picture is similar in concept to a Problem Domain Context …

To access this content, you must purchase a Membership - check out the different options here. If you're a member, log in.

Static Models

16 November 2021 by Phillip Johnston • Last updated 1 December 2021A static model defines the structural elements of a system as well as the attributes of the elements and the relationships between elements. The structural elements are usually defined in terms of “blocks” in the total hardware/software system and “classes” in a software system. Relationships in Static Models The three main types of relationships between structural elements are: Association relationships Whole/part relationships Generalization/specialization relationships Examples of Static Models SysML Block Diagrams UML Class Diagrams System Context Models References Real-Time Software Design for Embedded Systems by Hassan Gomaa, Section 5.1 …

To access this content, you must purchase a Membership - check out the different options here. If you're a member, log in.

Rich Picture

16 November 2021 by Phillip JohnstonA Rich Picture is a method for defining and exploring a given “situation” through diagrams. They are particularly useful for depicting complex situations with multiple components and interactions. Ruth Malan often refers to rich pictures as “sketchprototypes”, since they allow you to try out different ways that the situation may play out, in different settings, with different potential solutions. Estimated duration: 30-120 minutes Purpose Rich pictures are usually drawn during the exploratory stages of a project, before we know much about the system we’re building. Rich pictures allow us to work informally and quickly to …

To access this content, you must purchase a Membership - check out the different options here. If you're a member, log in.

Paper: The Secret History of Information Hiding

27 August 2021 by Phillip JohnstonThis paper goes into some of the history leading up to the development of Parnas’s idea of information hiding. Abstract The concept of “information-hiding” as a software design principle is widely accepted in academic circles. Many successful designs can be seen as successful applications of abstraction or information hiding. On the other hand, most industrial software developers do not apply the idea and many consider it unrealistic. This paper describes how the idea developed, discusses difficulties in its application, and speculates on why it has not been completely successful. Files The Secret History of Information …

To access this content, you must purchase a Membership - check out the different options here. If you're a member, log in.

Paper: Use of Abstract Interfaces in the Development of Software for Embedded Computer Systems

26 August 2021 by Phillip Johnston Last updated 8 December 2021“Use of Abstract Interfaces in the Development of Software for Embedded Computer Systems”, by David Parnas, was published in 1977 and is a precursor to the excellent “A Procedure for Designing Abstract Interfaces for Device Interface Modules” (one of my all-time favorite embedded software papers). I’m working on patterns for managing hardware dependencies in embedded systems software, and I wanted to make sure I included all of the relevantly named papers I can find in my research. Abstract This report describes a procedure for designing computer systems that are developed …

To access this content, you must purchase a Membership - check out the different options here. If you're a member, log in.

Avoid Mixed Metaphors

Our goal is to create software that is cohesive and exhibits separation of concerns (ideally embodying the single responsibility principle). One common way that we violate these principles, as Jerry Fitzpatrick points out in Timeless Laws of Software Development, is that we mix metaphors.

Jerry points out that we commonly fail to differentiate between metaphors that are related to products, producers, and processors.

  • A product is an abstraction whose instances are created for use by client code
    • For example, imagine a real-world manufacturer who produces bolts, radios, cars, or other products
    • A client must obtain the product to use it
  • A producer is an abstraction responsible for creating a product
    • For example, imagine a manufacturer or supplier in the real world
    • A producer may create multiple products, but a product never creates itself or destroys itself
    • In simple cases, client code may act as a producer by creating products directly. At other times, client code may use a separate producer abstraction (e.g., factory method or abstract factory) to create products
  • A processor is an abstraction that manipulates a product in some way.
    • A processor might repair a product, rearrange it, store it, operate on it, or adjust it in various ways
    • A processor never creates a product or vice versa.
    • Likewise, a processor never creates a producer or vice versa.

As described above, we will often use products, processors, and producers together. However, in order to come up with a cohesive design that separates concerns, we need to make sure these abstractions are independent.

Jerry gives the example of a Message class that contains serialization and deserialization procedures:

  • In operation, a blank Message is instantiated
  • Then its deserialization procedure is called, filling the Message with values from the mainframe.
  • Later, after the object has been modified, its serialization procedure is called to send all the Message values to the mainframe.

This design mixes all three metaphors – the Message class is the product, producer, and processor. Instead we can improve the cohesiveness and reusability of this design by:

  • Having the Message class be only a product
  • Creating a producer, e.g. MessageDeserializer, which creates a Message instance
  • Creating a processor, e.g. MessageSerializer, which sends message values to the mainframe

As another example, consider a temperature sensor driver which reads the temperature and monitors for temperature swings and notifies objects when an unexpected swing occurs. This metaphor is mixed in the following ways:

  • The driver produces temperature data points
  • The driver processes these samples to identify unexpected swings
  • The driver produces notifications when a swing occurs

The problem with mixing these metaphors is that now objects which shouldn’t need to know anything about the specific temperature sensor module are now coupled with it (in order to register for notifications). A design that does not use mixed metaphors would involve more components, but each component would be more independent, and changes in one would not necessarily require changes to the others. This might look like:

  • A producer (TemperatureDriver), which can send the product (TemperatureSample) to interested parties
  • One such interested party can be the TemperatureSwingMonitor that processes samples and monitors for temperature swings
  • If a temperature swing is detected, the TemperatureSwingMonitor uses a NotificationCenter (producer) to generate a TemperatureSwingDetected notification (product) and send it to registered listeners

By splitting up the metaphors, we can reduce coupling in the system, increase the reusability of the various components, and keep clients decoupled from both the TemperatureDriver and the TemperatureSwingMonitor.

Certainly, we will not always require the use of product, producer, or processor abstractions. We might see mixed metaphors in different ways. Keep the core lesson in mind: we can improve our designs by identifying mixed metaphors and splitting them up appropriately.

References

Differentiating Encapsulation and Information Hiding

13 July 2021 by Phillip Johnston • Last updated 6 March 2024Information Hiding and Encapsulation are two software design principles that are closely related. Encapsulation often requires some information hiding, so the two certainly techniques go hand-in-hand. However, in many sources they are considered to be synonymous terms. The confusion between the two concepts is not helped by the fact that there is no singular, precise definition used – instead, you’ll find variance across sources. We can dispel the idea that they are synonymous with a single observation: if encapsulation and information hiding are equivalent terms, then we can argue …

To access this content, you must purchase a Membership - check out the different options here. If you're a member, log in.

Paper: Is Design Dead?

21 June 2021 by Phillip JohnstonIn our summary of Martin Fowler’s article “Is High Quality Software Worth the Cost?”, I described challenges I face when trying to perform up front design or analysis before diving into a new project, no matter how short the proposed effort is. Fowler gives us arguments that we can use for explaining why we think high quality software is worth the investment. Luckily for us, Fowler is in a nice position for this analysis: he’s a proponent of the Extreme Programming (XP) movement, while also being deeply involved in graphical design languages – he wrote …

To access this content, you must purchase a Membership - check out the different options here. If you're a member, log in.