Design and Implementation

Design and Implementation

Software design and implementation represent a crucial stage in the software engineering process.

In simpler systems, these activities often encompass the entirety of software engineering, merging with other processes. However, for larger systems, they are just part of a broader set of processes including requirements engineering, verification, and validation.

Software design and implementation activities are typically interleaved, with the design informing the implementation and vice versa.

Object-Oriented Design using UML

  • Comprised of interacting objects with private state and operations.

  • Object-oriented design involves designing object classes and their relationships, defining objects and interactions.

  • Easier to change compared to functional approaches.

  • Objects encapsulate both data and operations, allowing for standalone modification without affecting other system objects.

  • Clear mapping between real-world entities and controlling objects improves understandability and maintainability.

To develop a system design from concept to detailed, object-oriented design there are several things that you need to do:-

  • Understanding and defining the system's context and external interactions.

  • Designing the system architecture.

  • Identifying principal objects.

  • Developing design models.

  • Specifying interfaces.

This UML consists of several factors like -

  1. System context and interactions.

  2. Architectural design.

  3. Object class identification.

  4. Design models.

  5. Interface specification.

Now let us understand about each of them in detail-

  1. System context and interaction:-

    The first stage in any software design process is to develop an understanding of the relationships between the software that is being designed and its external environment. This is essential for deciding how to provide the required system functionality and how to structure the system to communicate with its environment.

    • Key to developing software design.

    • Essential for determining system functionality and structure.

    • Establishes system boundaries.

System context models and interaction models present complementary views of the relationships between a system and its environment:

  1. A system context model is a structural model that demonstrates the other systems in the environment of the system being developed.

  2. An interaction model is a dynamic model that shows how the system interacts with its environment as it is used.

  1. Architectural design:-

    Once the interactions between the software system and the system’s environment have been defined, you use this information as a basis for designing the system architecture.

    • Defined interactions between the software system and environment.

    • Combines with general architectural principles and domain knowledge.

The high-level architectural design for the weather station software is shown in Figure. The weather station is composed of independent subsystems that communicate by broadcasting messages on a common infrastructure, shown as the Communication link in Figure. Each subsystem listens for messages on that infrastructure and picks up the messages that are intended for them. This is another commonly used architectural style.

For example, when the communications subsystem receives a control command, such as shutdown, the command is picked up by each of the other subsystems, which then shut themselves down in the correct way. The key benefit of this architecture is that it is easy to support different configurations of subsystems because the sender of a message does not need to address the message to a particular subsystem

  1. Object class identification:-

    By this stage in the design process, you should have some ideas about the essential objects in the system that you are designing. As your understanding of the design develops, you refine these ideas about the system objects. The use case description helps to identify objects and operations in the system.

    At this stage in the design process, you should focus on the objects themselves, without thinking about how these might be implemented. Once you have identified the objects, you then refine the object design. You look for common features and then design the inheritance hierarchy for the system. For example, you may identify an Instrument superclass, which defines the common features of all instruments, such as an identifier, and get and test operations. You may also add new attributes and operations to the superclass, such as an attribute that maintains the frequency of data collection.

  2. Design models:-

    Design or system models show the objects or object classes in a system. They also show the associations and relationships between these entities. These models are the bridge between the system requirements and the implementation of a system.

    An important step in the design process, therefore, is to decide on the design models that you need and the level of detail required in these models. This depends on the type of system that is being developed. You design a sequential data-processing system in a different way from an embedded real-time system, so you will need different design models.

    When you use the UML to develop a design, you will normally develop two kinds of design models:

    1. Structural models:- describe the static structure of the system using object classes and their relationships. Important relationships that may be documented at this stage are generalization (inheritance) relationships, uses/used-by relationships, and composition relationships.

    2. Dynamic models:- describe the dynamic structure of the system and show the interactions between the system objects. Interactions that may be documented include the sequence of service requests made by objects and the state changes that are triggered by these object interactions.

In the early stages of the design process, I think three models are particularly useful for adding detail to use case and architectural models:

Subsystem models:- which show logical groupings of objects into coherent subsystems. These are represented using a form of class diagram with each subsystem shown as a package with enclosed objects. Subsystem models are static (structural) models.

  1. Sequence models:- which show the sequence of object interactions. These are represented using a UML sequence or a collaboration diagram. Sequence models are dynamic models.

  2. State machine model:- which shows how individual objects change their state in response to events. These are represented in the UML using state diagrams. State machine models are dynamic models.

  3. Interface specification:- An important part of any design process is the specification of the interfaces between the components in the design. You need to specify interfaces so that objects and subsystems can be designed in parallel. Once an interface has been specified, the developers of other objects may assume that the interface will be implemented. Interface design is concerned with specifying the detail of the interface to an object or to a group of objects.