Professional Documents
Culture Documents
C3.1
S2 Aim of the architectural design
• The aim of the architectural design is:
Design and coordinate the system's blueprint,
which guarantees the required functional and non-functional requirements,
and document this in a complete and concise architectural description, on the basis of which creation,
maintenance, care and further development can be aligned.
• The architecture description serves as
Communication and discussion platform
Design and implementation plan
S3
S11
S12
S15Coupling (1)
• What is coupling?
–Developed by the interdependency of two or more components
–Defines the degree of dependency
–Indicates how much changes to components affect others
The goal is a low coupling between components
S17Cohesion
Cohesion describes the content-relatedness of components with regard to their area of responsibility.
The goal is high cohesion within a component.
• Do the contents really belong together within a component?
S18Cohesion & coupling
Low cohesion and high coupling
“High communicative scenario” - Bad
High cohesion and low coupling
“Low communicative scenario” - Good
Coupling and cohesion can be measured using metrics!
S19 Measuring cohesion
LCOM - Lack of Cohesion Metric (1)
Compositional interplay of high cohesion, appropriate abstraction and information hiding as well as a low
coupling
A common way to determine the components of an architecture is to look at the dependencies.
• "Group" elements with strong dependency
• Dependencies between components become interfaces
• Once the architecture is defined, it provides guidelines for the introduction of new dependencies
S25 YAGNI –You Ain’t Gonna Need It
• observations
Inaccurate requirements are often compensated for by products that try to compensate for the
inaccuracy.
Constantly changing requirements are updated in the product as quickly as possible, because this is
possible thanks to the immateriality of software.
Precedented obedience
• Problems that arise from this
Unnecessarily complex software
Each line of code written, even if it is never used, costs time and money. Especially after it was written!
•That's why
“Things that nobody needs have no value. So don't waste time on them. "
Question what is really required and needed.
S26-28 Design byContract (1)
• Design byContract contains a number of principles for component-based software development
• Analogy with contracts in business
The components conclude contracts with each other
A contract includes the promise of a program component to provide a certain service if certain conditions
are met.
Put the program together in such a way that it works properly if only all of your contracts are met.
Contracts between classes have e.g. following form:
If a certain requirement is met before calling a method in a class, the class is put into a certain state by
executing the method.
A contract for a method consists of:
Precondition
What assumptions are made about the arguments of the method and the state of the class.
Condition
What performance does the method provide, i.e. which property applies after its execution.
In Class invariant
At any point in time, the state of the class fulfills a certain property (the invariant).
S29 Law of Demeter (1)
• "Objects should only communicate with objects in their immediate vicinity."
• Also called the "principle of secrecy".
• Reduces the coupling
• A method should only use the following methods:
-Methods of your own class
-Methods of the passed parameters
-Methods of the classes associated with your own class
-Methods of objects that the method itself created
Note: Interfaces should be structured by subject. Therefore, do not align them exclusively to the
needs of all clients.