Lecture 7 - System Design Flashcards
What is the purpose of System Design?
Bridge the gap between the system requirements and a system implementation in a manageable way
What is System Design?
A creative process -no cook book solutions
Goal driven - we create a design for solving some problem
Constraint driven - by the function to be served and the constructions which are possible
Good designs can be recognised - simple, coherent, adequately meets requirements, adaptable
What is the System Design Process?
Transforms the analysis model by
- defining the design goals of the project
- decomposing the system into smaller subsystems
- selection of off-the-shelf and legacy components
- mapping subsystems to hardware
- selection of persistent data management infrastructure
- selection of access control policy
- selection of global control flow mechanism
- handling of boundary conditions
System Design Activity Diagram
REFER TO SLIDES
What is Modularity?
“modularity is the single attribute of software that allows a program to be intellectually manageable” [Mye78].
Basically:
Making the system that everyone can understand
- Separating components into different ‘bits’ or sections
- Makes it easier to understand
- In almost all instances, you should break the design into many modules, hoping to make understanding easier and as a consequence, reduce the cost required to build the software.
Examples of Modularity
REFER TO NOTES/SLIDES
What are Box and Line Diagrams?
Showing decomposition diagramatically
- Useful for stakeholder communication
- May be used as a focus of discussion by system stakeholders.
What are the characteristics of Box and Line Diagrams?
- Very abstract - they do not show the nature of component relationships nor the externally visible properties of the sub-systems.
- However, useful for communication with stakeholders and for project planning.
REFER TO SLIDES
What is Information Hiding?
Information hiding is the idea that every module should hide aspects of its implementation - exposing only an undestandable interface
Why do we use Information Hiding?
- reduces the likelihood of “side effects”
- limits the global impact of local design decisions
- emphasizes communication through controlled interfaces
- discourages the use of global data
- leads to encapsulation—an attribute of high quality design
- results in higher quality software
What are Class Diagrams in System Design, specifically what is a Subsystem?
- A first step in system design is to break down the solution domain into simpler parts.
- A subsystem is a collection of classes, associations, operations, events and constraints that are inter-related
- Identifying subsystems usually involves backtracking, evaluation and revision of various solutions
What is important to get the decomposition right in subsystems
- subsystems usually implemented by different teams
- bad decomposition can lead to unworkable designs
What are the Heuristics to Identify Subsystems?
Consider the objects and classes in your requirements analysis models.
Try grouping objects into subsystems by:
- assigning objects in one use case into the same subsystem
- create a dedicated subsystem for objects used for moving data among subsystems
- minimizing the number of associations crossing subsystem boundaries
- ensure all objects in the same subsystem are functionally related
What are Primary Questions in regards to Subsystems?
What kind of service is provided by the subsystems?
What are Secondary Questions in regards to Subsystems?
Can the subsystems be hierarchically ordered (layers)?
What is the criteria for selecting subsystems?
Most of the interaction should be within a subsystem and not across subsystem boundaries
How do you know when a design is Modular?
- Each activity of the system is performed by exactly one
component - Inputs and outputs of each component are well-defined, in that every input and output is necessary for the function of that component
- The idea is to minimise the impact of later
What is the goal of Coupling and Cohesion?
Reduction of complexity while change occurs
What does Cohesion measure?
Cohesion measures the dependence among classes
- High cohesion: The classes in the subsystem perform similar tasks and are related to each other (via associations)
- Low cohesion: Lots of miscellaneous and auxiliary classes, no associations
What does Coupling measure?
Coupling measures dependencies between subsystems
- High coupling: Changes to one subsystem will have high impact on the other subsystem (change of model, massive recompilation, etc.)
- Low coupling: A change in one subsystem does not affect any other subsystem
Why should Subsystems have maximum cohesion and minimum coupling as possible?
High cohesion: Parts of the subsystem work closely together
Low coupling: Subsystems interect minimally with others
What is Coupling?
Coupling is the strength of dependencies BETWEEN two
subsystems
In general, the fewer dependencies between subsystems the better it is
Why is it better to have few dependencies in Coupling?
By reducing coupling, developers can introduce many unnecessary layers of abstraction that consume development time and processing time
What are the Coupling Levels
- Content coupling: when one module modifies or relies on the internal workings of another module
- Common coupling: when two modules share the same global data
- Control coupling: when one module controlling the logic of another, by passing its information on what to do
- Stamp coupling: when modules share a composite data structure and use only a part of it
- Data coupling: when modules share data through parameters
Uncoupled: when nothing is shared
What is Cohesion?
- Coherence (or cohesion) is the strength of dependencies WITHIN a subsystem
- In general, the stronger the dependencies within a subsystem the better it is
- Strong coherence is best, middle level is better but low
coherence must be avoided
What are the Cohesion levels?
- Functional cohesion (best): when parts of a module all
contribute to a single well-defined task of the module - Sequential cohesion: when parts of a module are grouped because the output from one part is the input to another part
- Communicational cohesion: when parts of a module
operate on the same data - Procedural cohesion: when parts of a module always
follow a certain sequence of execution - Temporal cohesion: when parts of a module are grouped when they are processed
- Logical cohesion: when parts of a module are grouped because they logically do “the same thing” in some way
- Coincidental cohesion (worst) : when parts of a module
are grouped arbitrarily (at random).
What is Partioning and Layering (together) used for?
Partitioning and layering are techniques to achieve low coupling.
A large system is usually decomposed into subsystems using both, layers and partitions.
What are Partitions?
Divide a system into several independent (or weakly-coupled) subsystems that provide services on the same level of abstraction – i.e. they are on the same “layer”
What is a Layer?
A layer is a subsystem that provides subsystem services to a higher layers (level of abstraction)
- A layer can only depend on lower layers
- A layer has no knowledge of higher layers
Partioning and Layering Example
REFER TO SLIDES
Look at relationship of diagrams on following slides
How does Layering help?
- Supports incremental development of sub-systems in different layers.
- When a layer interface changes, (potentially) only the adjacent layer is affected.