Unit 5 - Structural modelling Flashcards
What are the agile modelling principles?
- Lightness and simplicity take precedence over completeness and complexity.
- Models should only be pursued while they are of use.
- Ease of change and adaptability also need to be part of the modelling process.
p. 7
The four useful sources when looking for objects are…?
- tangible objects – the physical things in the domain, such as rooms, bills, books and vehicles
- roles – the roles played by people in the domain, such as employees, guests and members of some organisation
- business transactions – the activities, episodes and interactions, such as room reservations, vehicle registrations, orders, deliveries and transactions
- organisational units – the groups to which people belong, such as accounts departments, production teams and maintenance crews.
Why do object modellers concentrate on nouns?
The nouns represent the things in the domain being modelled, and things are more stable than actions, which are expressed as verbs.
SAQ 1
When modelling objects, what are the basic filtering criteria that can be applied to reduce the number of objects?
- different concepts that are expressed using the same name
- redundancy, the same concept, given different names
- not important or independent enough, such as an attribute of another concept rather than a concept in its own right
- lack of relevance to the problem domain, being either beyond the scope of the desired system
SAQ 1
Explain why object diagrams cannot form the basis for a software specification.
Object diagrams represent particular states of the system at particular moments in time, whereas a specification must describe all valid states of the system at all possible times.
SAQ 2
In connection with rooms in a hotel, a hotel manager’s vocabulary might include the words ‘occupied’ and ‘free’. How might such words be represented in a class diagram?
- as an attribute of the Room class
- as an association between the Room and Guest class.
SAQ 3
What characterises the state of an object at a particular point in time?
The state of an object is characterised by the value of each of its attributes at that point in time.
SAQ 4
What does an attribute of a class represent?
An attribute represents a particular property (a named value) of the class that each instance of that class will have. At any one time they collectively define the state of an instance of the class.
SAQ 4
Does a multiplicity of 1 indicate that there can be no change in the object to which the multiplicity relates?
No. It merely means that at any one time there will be exactly one object at that end of the relationship. The attributes, or even the identity, of this object may change over time.
SAQ 5
If an airline system models flights and pilots, and each flight needs two pilots, would you use a multiplicity of 2?
Probably not. There are probably times during the life of a Flight object when fewer than two pilots are allocated, such as when the flight has been scheduled but crew details have not yet been settled.
SAQ 5
Suppose that a shoe shop has a number of cupboards and each cupboard contains an even number of shoes. How could you model the evenness of the shoes?
You might use a multiplicity on the association between the classes Cupboard and Shoe, indicating that valid values are 0, 2, 4, 6, 8 and so on up to some reasonable limit. Alternatively you could say that a Cupboard contains an arbitrary number of instances of a class called ShoePair, where each ShoePair contains one left shoe and one right shoe. This approach generalises more easily to situations where the groups are not homogeneous. For example, a table setting contains one knife, one fork and one spoon.
SAQ 5
If a model contains role names, do you also need to use association names?
No, but it is sometimes convenient to have a name for the association as a whole. For example, you might focus on what is meant by works for rather than the need to consider both the role employer and the role employee (at the same time).
SAQ 5
What is a navigation expression used for?
It provides a way of naming another object or its attributes relative to a starting object by referring to intermediate role names.
SAQ 5
What is a recursive association?
A recursive association is an association where both ends terminate at the same class.
SAQ 5
When considering attributes, what is the effect of moving from a conceptual model to an analysis model?
The conceptual model records attributes of classes that will be familiar to a domain expert. In the analysis model, the developer must consider the representation of attributes within a software system.
Example
A hotel manager will be familiar with the daily rate for a room and whether or not it is occupied. For a developer, daily rates for rooms involve money and you can use a true/false (Boolean) expression to represent the occupancy of rooms.
SAQ 6
Why is a class model not sufficient to describe a system?
A class model is a static model that describes the elements of a system (the classes) and their relationships (the associations) but does not describe the behaviour of the system over time. For this you will need one or more dynamic models. In particular, you need to model the life histories of objects and the interactions between them. The model needs to capture when instances of classes should be created and destroyed.
SAQ 7
What is meant by navigability? When is this idea useful?
Navigability means that it is possible to identify (or ‘reach’) objects in one class from objects in an associated class. The usefulness of this idea is realised during implementation, when navigability in one direction alone (unidirectional navigability) can lead to simpler code.
SAQ 8
What is a qualified association?
A qualified association is an association at one end of which there is a qualifier, consisting of one or more attributes. The values of the attributes (taken together) uniquely identify the objects in the class at the other end of the association.
SAQ 9
Under what circumstances would you want to show an association that is not independent of other associations (i.e. might be derived from other associations) in the diagram?
If a word describing an association is part of the natural vocabulary of the domain expert, it will be sensible to include it in the model, as otherwise a linguistic gulf will start to open between the domain expert and the system designer. However if you know that an association is not essential, because it can be derived from other associations, you will also need to record that fact.
SAQ 10
What is the difference between inheritance and generalisation?
Inheritance is the consequence of a generalisation/specialisation relationship; a subclass inherits the features of the superclass. However the term inheritance tends to be used by programmers, whereas the terms generalisation and specialisation are used by analysts and modellers.
SAQ 11
In a computer graphical user interface, how might you represent the relationship between a full window and an iconised window from the classes FullWindow and Icon respectively? List the operations that are common to both and those that are peculiar to each.
You could introduce a new, abstract class named Window and let the other classes inherit from it as follows: - abstract class Window with operation display - subclass Icon with additional operation maximise - subclass FullWindow with additional operations iconise and scroll.
SAQ 11
What is an invariant?
It is a constraint – something that must be true about the system at all times.
p. 56
Name some common constraints.
- constraints on the values of attributes
- constraints on associations
- uniqueness constraints (which can sometimes be converted to qualified associations).
p. 56
When should an invariant on a class be true?
The invariant on a class must be true for every object of that class from the time that object is created to the time it is deleted.
SAQ 12

