Software Design Principles and UML Diagrams Explained
Classified in Computers
Written on in English with a size of 4.2 KB
Dimensions of Software Design
Software design involves several key dimensions:
- Problem solving
- Modeling
- Specification
- Organizing the solution
- Communication
- Economics and reuse
- Maintenance and evolution
Design Approaches
Divide-and-Conquer
A problem is decomposed into subproblems that are worked on independently. This approach can be applied recursively for complex problems and allows managers to allocate work to multiple people.
Procedural Design
Design is viewed as a set of procedures that are composed:
- Sequentially
- Conditionally
- Iteratively
- Hierarchically
Borderline Procedural Design
In this approach, the main steps are not fixed. The user has choices with few constraints, and there is typically a main loop to find the next operation.
Event-Driven Design
This approach is good for systems driven by external sources of events. It uses event handlers, and events can occur and be handled concurrently. Designers must think in terms of listeners; responding to an event can require complex processing.
Alternative Designs
The designer explores alternatives. To evaluate them:
- Identify alternatives
- Sketch each alternative
- Discuss the options
- Find advantages and disadvantages
Recognition-Primed Decision Model [Klein]
A tentative plan is formed through associative memory, mentally simulated, and modified as needed.
Quality Factors in Design
Key quality factors include:
- Completeness
- Efficiency
- Maintainability
- Portability
- Reliability
- Security
- Simplicity
- Understandability
Metrics for these factors can be computed by analyzing formal design descriptions, through data collected when using a prototype, or through subjective judgment (e.g., user ratings).
Modularization Principles
Create modules with a clear interface and implementation. Modules should exhibit:
- Low Coupling: Change in one module has minimal impact on others.
- High Cohesion: Elements within a module are closely related and work together.
Modularization encapsulates design decisions.
Object-Oriented Design
Focuses on objects with state (values) and behaviors (methods), organized into classes and instances.
- Analysis: The initial phase involves identifying real-world objects and their services.
Graphic Models for Design
Graphic models are used to aid understanding. Types include:
- Object and Class Diagrams
- Data Flow Diagrams
- Finite-State Machines
The Design Document
Provides essential guidance. Characteristics of a good design document:
- Concise and easy to understand
- Specific
- References requirements
- High-level overview
- Describes major components and relationships
- Modular structure
- Includes a history of changes
UML Diagrams
UML (Unified Modeling Language) is a collection of diagrams used in business processes and software design.
Class Diagram
Shows the static structure, related classes and interfaces with their attributes, relationships, and constraints.
Package Diagram
Shows the structure at the level of packages; packages can import other packages.
Object Diagram
Depicts objects and their relationships at a specific point in time; it is an instance of a class diagram.
Sequence Diagram
An interaction diagram that depicts the lifelines of objects and the sequence of messages exchanged between them.
State Machine Diagram
Shows discrete behavior through state transitions.
Component Diagram
Shows how components are connected; depicts components, interfaces, and ports.
Activity Diagram
A behavior diagram that shows the flow of control and emphasizes the sequence and conditions of the flow.
UML Limitations
UML is not adequate for all purposes; custom diagrams may be needed.