SE-Design and Implementation
Design
What is architectural design?
A software architectural design is an abstract decomposition of a system into large-grain components, each of which may be a substantial system in its own right.
- Identify subsystems
- Establish relationships between the subsystems
Why is architecture design important?
A good software architecture can help
- Communication
- Developers in different phases can understand
- System analysis
- Complexity analysis
- Large scale reuse
- The reuse of subsystems
How can we assess an architecture?
- Abstraction
- Pattern
- Modularity
- Information hiding
- Independence
- Refinement
- Refactoring
What are the design principles
- Abstraction: Focusing on the essential aspects of an entity while ignoring accidental properties. This can be procedural or data abstraction.
- Pattern: Describing a design structure that solves a particular design problem within a specific context. Patterns should be sufficiently abstract to be reused in different settings. Architectural patterns, design patterns, and coding patterns exist.
- Modularity: The attribute of software that makes a program intellectually manageable, often employing a divide and conquer strategy to handle complexity.
- Information hiding: Design decisions within a module are invisible from outside the module. This helps reduce the impact of changes, facilitates component reuse, and simplifies interfaces.
- Independence: Assessed through Coupling and Cohesion.
- Coupling: Measures the dependencies between two subsystems. Lower coupling is better. Communicating via parameter passing is generally the best, while communicating via global data is worst.
- Cohesion: The measure of the functional relatedness within a module or subsystem. Higher cohesion is better. Decomposition should aim for high cohesion and low coupling.
- Refinement: A process of elaboration, which is the opposite of abstraction, moving from abstract concepts to more specific details.
- Refactoring: A method that reorganizes the architecture to improve the design.
What design models have we learnt
- Repository model
- Repository is shared by the subsystems
- Advantages: No direct transmission between two subsystems
- Disadvantages:
- The information handling is centralized
- The changes in repository may affect many subsystems
- The repository manager is responsible
- Subsystem cannot have their own policies
- Repository is shared by the subsystems
- Client-Server model
- The services offered by servers can be used by clients through network
- The services offered by servers can be used by clients through network
- Layered model
- The upper layers use the lower layers through defined standard interface
- The upper layers use the lower layers through defined standard interface
- MVC model (Model-View-Controller) often used in combination with others like the Layered model
- Model subsystems: maintain the real world objects
- View subsystems: display the data in model subsystems to users
- Controller subsystems: manage the sequence of interactions with the users
- Model does not depend on any view or controller
- Changes in the models are detected and displayed by view subsystems subsystems
Object-Oriented Software Development
- Develop the software which is a collection of objects that incorporate both data structure and behavior
- OO software development
- Object-Oriented Analysis (Requirements specification)
- Object-Oriented Design (Architectural Design)
- Object Design (Detailed Design)
- Object-Oriented Programming (Implementation)
- Essence
- Identify and organize the application domain objects
- Do NOT consider the representation in programming languages
What is detailed design?
- Detailed design:
- refine the classes from the perspective of programming,
- prepare for implementation,
- Give detailed information for implementation
What do we do in detailed design?
- Refine the classes from the perspective of programming.
- Prepare for implementation.
- Give detailed information for implementation.
- Perform Interface design for classes.
- Identify missing attributes and operations.
- Specify the signature of attributes (e.g., range, built-in types).
- Specify the signature of operations (return type, name, parameters, their types).
- Specify the visibility of attributes and operations (private, protected, public).
- Specify pre- and post-conditions for methods if necessary.
- The goal is to make the class interface more detailed.
- Perform restructuring of the design.
- This means adjusting the design towards implementation.
- In Object-Oriented design, this can involve changing n-ary associations to binary, increasing inheritance, collapsing classes into attributes, or using qualifiers.
- In Structured Design, this involves restructuring the structured call tree based on considerations like Coupling, Cohesion, and Database process.
Why do we need detailed design?
- To refine the classes from the perspective of programming.
- To prepare for implementation.
- To give detailed information for implementation.
- To make the class interface more detailed through interface design.
- To restructure the design towards implementation.
Object-Oriented Design-An Example
- Group objects into subsystems that can be implemented by individuals
- Assign objects identified in one use case into the same subsystem
- Create a dedicated 专用 subsystem for objects used for moving data among subsystems
- Minimize the number of associations crossing subsystem boundaries
- All objects in the same subsystem should be functionally related.
- Design an architecture for each subsystem
- Use layered model + MVC model
- Identify the persistent data
- Each persistent class should be saved in a table
- Each association should be saved too.
- Refine Architecture
- Allocate the tables to storage in different subsystem. One table cannot appear in multiple subsystems.
We can group the objects into subsystems so that they can be developed by individuals.
A system decomposition can be revised by merging, splitting, and add systems.
For every subsystem, we can give the further architecture for it.
The design fundamentals must be followed in the architecture design.