Unit 9 - Architecture, patterns and reuse Flashcards

1
Q

Suggest a reason why choosing the architecture very late on might be a bad idea.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Think of some reasons why reuse is desirable.

A
  • 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the various ingredients that make up a framework?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

List the various forms of reuse and say briefly what is reused in each case.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the difference between generalisation and realisation?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Discuss possible advantages of separating the user interface from the domain logic.

A
  • 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Where in the hotel system might we use a singleton?

A

We could use a singleton instance of HotelChain as a system object that all messages from the user interface are sent to.

SAQ 7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Suggest some quality requirements that the Factory pattern might help satisfy.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly