Module 3 (1)
Module 3 (1)
Module 3 (1)
The design process is a crucial stage in software engineering, involving the systematic
transformation of specified requirements into a blueprint for constructing a software product.
According to Ranjib Mall, the design process aims to ensure that the software meets its
functional and performance requirements while adhering to constraints such as cost, time,
and technical feasibility.
The software design process can be divided into two key levels:
The design process is iterative and often revisited to refine and optimize solutions. Early
designs might focus on achieving functionality, while subsequent iterations improve
performance, reliability, and maintainability.
Design Quality
Design quality ensures that the software product is robust, maintainable, and aligns with
user expectations. Ranjib Mall identifies several attributes that define design quality:
1. Correctness:
The design should accurately meet the specifications and requirements set forth in
the analysis phase.
2. Understandability:
The design should be easy for developers to comprehend, facilitating maintenance
and further development.
3. Efficiency:
Resources like memory, CPU, and bandwidth should be utilized optimally.
4. Reusability:
Components of the design should be general enough to be reused in other projects
or modules.
5. Modifiability:
The design should allow for easy modifications to accommodate changes in
requirements or enhancements.
6. Completeness:
All specified functionalities should be addressed, leaving no ambiguous or
incomplete aspects.
7. Testability:
The design should make it easy to write test cases and validate the system against
requirements.
2. Design Concepts
Ranjib Mall emphasizes key design concepts that serve as principles to guide the creation
of software designs. These are foundational ideas that ensure the design process remains
consistent and effective.
1. Abstraction
Abstraction is the process of simplifying complex systems by focusing on relevant
details while ignoring irrelevant ones. It is achieved through hierarchical
representation, such as high-level abstractions (system-level) and low-level
abstractions (module-level).
2. Modularity
○ Definition: Dividing the software system into smaller, manageable
components or modules.
○ Benefits: Improves maintainability, enhances reusability, and isolates faults.
○ Each module should follow the principle of high cohesion (focused
responsibility) and low coupling (minimal dependencies).
3. Encapsulation
○ Bundling data and methods that operate on the data into a single unit,
typically a class in object-oriented design.
○ Ensures data hiding, meaning that internal details of a module are not
exposed to the outside.
4. Separation of Concerns
○ The design should separate different functionalities into distinct modules.
○ For instance, business logic, data access, and presentation layers should be
designed independently.
5. Hierarchy and Layering
○ A hierarchical structure organizes modules in levels, ensuring a clear
relationship between components.
○ Examples include the layered architecture in web applications (e.g.,
presentation, application, and data layers).
6. Refinement
○ Gradually elaborating on the design by moving from abstract concepts to
concrete details.
○ Refinement aligns with iterative development models.
7. Structural Design Concepts
These include organizing modules based on their control and data flow, such as call
and return mechanisms, and the use of shared data.
3. Design Models
Design models are representations used to visualize, specify, construct, and document the
software architecture and components.
1. Data Design
○ Focuses on designing the data structures and database models.
○ Tools: Entity-Relationship Diagrams (ERDs), data dictionaries, and
normalization techniques.
2. Architectural Design
○ Represents the high-level structure of the system, including components and
their interactions.
○ Examples include layered architecture, microservices, and client-server
models.
3. Component-Level Design
○ Defines the internal structure of each module, such as its methods, data
attributes, and interfaces.
○ Tools: UML class diagrams, pseudocode, and flowcharts.
4. Interface Design
○ Specifies how modules communicate with one another and with external
systems.
○ Focuses on APIs, user interfaces (UI), and external hardware interfaces.
5. Behavioral Design
○ Describes the dynamic behavior of the system using tools like state diagrams
and sequence diagrams.
○ Explains how the system responds to various inputs and conditions.
4. Object-Oriented Design (OOD)
Overview
Principles of OOD
1. Encapsulation:
○ Bundling data and behavior into a single unit (object).
○ Ensures data hiding, exposing only necessary details.
2. Inheritance:
○ Allows one class (child) to inherit attributes and methods from another class
(parent).
○ Promotes code reuse and hierarchical relationships.
3. Polymorphism:
○ Enables a single interface to represent different data types or behaviors.
○ Example: A Shape class might define a draw() method, implemented
differently by Circle and Rectangle.
4. Abstraction:
○ Hiding implementation details while exposing only essential features.
○ Example: A user interacting with a Car object needs to know how to drive, not
the internal workings of the engine.
object oriented systems. A class diagram in the Unified Modeling Language (UML) is
a type of static structure diagram that describes the structure of a system by showing
the system's:
● classes,
● their attributes,
What is a Class?
A Class is a blueprint for an object. Objects and classes go hand in hand. We can't
talk about one without talking about the other. And the entire point of Object-Oriented
Design is not about objects, it's about classes, because we use classes to create
objects. So a class describes what an object will be, but it isn't the object itself.
In fact, classes describe the type of objects, while objects are usable instances of
classes. Each Object was built from the same set of blueprints and therefore
contains the same components (properties and methods). The standard meaning is
that an object is an instance of a class and object - Objects have states and
behaviors.
Example
A dog has states - color, name, breed as well as behaviors -wagging, barking,
(operations). Each attribute has a type. Each operation has a signature. The class
Class Name:
● Operations are shown in the third partition. They are services the class
provides.
● The return type of a method is shown after the colon at the end of the method
signature.
● The return type of method parameters are shown after the colon following the
Class Visibility
The +, - and # symbols before an attribute and operation name in a class denote the
Parameter Directionality
Each parameter in an operation (method) may be denoted as in, out or inout which
specifies its direction with respect to the caller. This directionality is shown before the
parameter name.
The choice of perspective depends on how far along you are in the development
process. During the formulation of a domain model, for example, you would seldom
move past the conceptual perspective. Analysis models will typically feature a
will typically start with heavy emphasis on the specification perspective, and
software
The perspective affects the amount of detail to be supplied and the kinds of
relationships worth presenting. As we mentioned above, the class name is the only
mandatory information.
UML is not just about pretty pictures. If used correctly, UML precisely conveys how
implemented code will correctly reflect the intent of the designer. Can you describe
what each of the relationships mean relative to your target programming language
shown in the
Figure below?
If you can't yet recognize them, no problem this section is meant to help you to
relationships with other classes. A relationship can be one of the following types:
Inheritance (or Generalization):
more specific classifier. Each instance of the specific classifier is also an indirect
instance of the general classifier. Thus, the specific classifier inherits the features of
SubClass2 are derived from SuperClass. The relationship is displayed as a solid line
with a hollow arrowhead that points from the child element to the parent element.
Inheritance Example - Shapes
The figure below shows an inheritance example with two styles. Although the
Association
Associations are relationships between classes in a UML Class Diagram. They are
represented by a solid line between classes. Associations are typically named using
a verb or verb phrase which reflects the real world problem domain.
Simple Association
that connects the <<control>> class Class1 and <<boundary>> class Class2. The
Cardinality
● one to one
● one to many
● many to many
Aggregation
a solid line with a unfilled diamond at the association end, which is connected to the
Composition
● A special type of aggregation where parts are destroyed when the whole is
destroyed.
a solid line with a filled diamond at the association end, which is connected to the
Dependency
An object of one class might use an object of another class in the code of a method.
If the object is not stored in any field, then this is modeled as a dependency
relationship.
The figure below shows another example of dependency. The Person class might
have a hasRead method with a Book parameter that returns true if the person has
Realization
Realization is a relationship between the blueprint class and the object containing its
respective implementation level details. This object is said to realize the blueprint
class. In other words, you can understand this as the relationship between the
For example, the Owner interface might specify methods for acquiring property and
disposing of property. The Person and Corporation classes need to implement these
Note that there are two types of sequence diagrams: UML diagrams and code-based
diagrams. The latter is sourced from programming code and will not be covered in this guide.
Lucidchart’s UML diagramming software is equipped with all the shapes and features you
will need to model both. And with our diagram as code feature, it’s faster and easier than
ever. You can create a custom sequence diagram on your Lucidchart document using
Mermaid coding.
What is a Collaboration?
Objects
An object is represented by an object symbol showing the name of the object
and its class underlined, separated by a colon:
Object_name : class_name
You can use objects in collaboration diagrams in the following ways:
● Each object in the collaboration is named and has its class specified
● Not all classes need to appear
● There may be more than one object of a class
● An object’s class can be unspecified. Normally you create a
collaboration diagram with objects first and specify their classes
later.
● The objects can be unnamed, but you should name them if you want to
discriminate different objects of the same class.
Actors
Normally an actor instance occurs in the collaboration diagram, as the
invoker of the interaction. If you have several actor instances in the same
diagram, try keeping them in the periphery of the diagram.
Links
Links connect objects and actors and are instances of associations and each
link corresponds to an association in the class diagram
Links are defined as follows:
Messages
A message is a communication between objects that conveys information with
the expectation that activity will ensue. In collaboration diagrams, a
message is shown as a labeled arrow placed near a link.