Unit 9 - Architecture, patterns and reuse Flashcards
Suggest a reason why choosing the architecture very late on might be a bad idea.
Choosing the architecture at a very late stage suffers from the risks of the waterfall approach. By then many other design decisions will have been taken and it will be too late to change them, even if they force us to adopt an architecture that is less than ideal.
An analogy could be with building a house. Would anyone dream of starting construction without an architectural design for the building?
SAQ 1
Think of some reasons why reuse is desirable.
- It avoids duplication of effort and reinventing already existing solutions, which saves resources.
- It promotes reliability because developers can use tried and trusted solutions.
- It speeds up development because developers can take existing solutions without starting from the beginning every time.
- It is a mechanism for spreading good practice among the software development community and familiarising practitioners with tried and tested solutions.
SAQ 2
What are the various ingredients that make up a framework?
A framework consists of an architecture, a small amount of software for the framework, a set of components suitable for use within the framework and the documentation needed to make use of the framework.
SAQ 3
List the various forms of reuse and say briefly what is reused in each case.
Architectural styles… reuse expertise in large-scale architectural design – the types of component used and the patterns of interaction between them.
Frameworks… reuse a particular architecture and a set of software components suitable for use within it.
Product lines… reuse reference architectures, software components and expertise about the variations needed to fulfil customer requirements.
SAQ 4
SAQ 4
What is the difference between generalisation and realisation?
Generalisation… expresses a subtyping relationship between two classes. The subclass is a specialised subtype of its superclass and inherits the attributes and operations defined by the superclass.
Realisation… is not a subtyping relationship but instead expresses the fact that a class provides an implementation for all the operations specified by an interface.
SAQ 5
Discuss possible advantages of separating the user interface from the domain logic.
- The user interface is not affected by changes in the implementation of the business logic.
- The same domain logic can be used with different user interfaces.
- The business logic can be tested separately from the interface logic.
SAQ 6
Where in the hotel system might we use a singleton?
We could use a singleton instance of HotelChain as a system object that all messages from the user interface are sent to.
SAQ 7
Suggest some quality requirements that the Factory pattern might help satisfy.
The ones we thought of were maintainability and portability (and flexibility if it is counted as distinct from maintainability). You may have come up with others.
SAQ 8