Unit 5 Flashcards

1
Q

What does a conceptual model represent?

A

The conceptual model represents elements of the problem domain.

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

What does an analysis model represent?

A

The analysis model represents entities from the software solution.

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

What is the first step in building a conceptual model?

A

To identify objects in the problem domain that may eventually be relevant to a solution

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

Describe four categories that provide a useful source for possible objects for a conceptual model.

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What document should be created at the beginning of a project?

A

A glossary of terms, or data dictionary.

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

What is the purpose of a glossary?

A

It cross-references the different words that are to be used on the project and explains how they interrelate – particularly important for establishing your understanding of key concepts in the problem domain.

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

What is a good starting point when considering candidate concepts for a conceptual model?

A

A list of nouns from a written description of a problem, such as a use case.

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

Why do object modellers concentrate on nouns?

A

The nouns represent the things in the domain being modelled, and things are more stable than actions, which are expressed as verbs.

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

What are the main criteria for filtering a list of nouns in order to remove inappropriate ones and settle upon a suitable set of candidate concepts?

A

There are basic filtering criteria that can be applied as follows:

  • 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

In addition to these basic criteria, you should pay particular attention to events. Will an instance of that kind of event have state, behaviour and identity that are significant in the problem domain? A loan of a book from a friend might not be worth modelling, for example, but a library loan is significant – it has a time limit and may incur a charge if that limit is exceeded.

In all cases, you should clear up any ambiguity with a domain expert or the users themselves.

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

In object-oriented modelling what is the main difference between an object and a class?

A

An object stands for something real in the problem domain, such as a specific customer or a specific room in a hotel. The properties of an object have values that can be tested. A class describes all possible objects of that kind, defining what the objects have in common.

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

What is one way to determine whether or not something should be modelled as a distinct class?

A

You should consider the life histories of instances (objects) and how their behaviour may change over time.

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

What does a class model demonstrate?

A

A class model indicates which classes are in the system and describes the associations between those classes. In the same way that a class describes what is true for all objects of that class, a class model describes what is true about the entire system at all times.

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

What does an object model demonstrate?

A

An object model is a collection of objects, where every object in the model is an instance of a class in the class model.

The object model represents one specific configuration of the system – a snapshot of the system at one instant in time.

No object can have attributes that are not in the class model and neither can objects have relationships that are not in the class model.

Just as an object is an instance of a class, an object model may be thought of as an instance of a class model.

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

How is an object model visually represented?

A

By an object diagram.

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

How is a class model visually represented?

A

By a class diagram.

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

What do links between objects represent on an object diagram?

A

They represent particular cases of one object ‘knowing about’ another object.

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

What are three benefits of an object diagram?

A
  • Object diagrams are extremely useful for checking your understanding of concepts and relationships. For example, you can use one or more of the object models to walk through the different scenarios for each use case.
  • Since an object diagram is a snapshot of the domain or the system at a particular moment in time, pairs of them can be useful in showing the domain or the system before and after some operation has been carried out.
  • An object diagram can be very useful for determining whether some configuration of objects is valid.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Explain why object diagrams cannot form the basis for a software specification.

A

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.

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

In a windowing system, a window may be converted to an icon and back to a full window. What operations can be performed on full windows but not on iconised windows? Would a model containing the classes Icon and FullWindow be able to capture the distinction adequately?

A

Scrolling and maximising can be done on full windows but not on iconised ones. It would be difficult to model the distinction between a full window and its iconised version adequately by using two different classes, since an object (in this case the window) cannot dynamically change its class. One solution would be to have a single class with an attribute that distinguishes between a window being iconised or fully open.

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

In connection with rooms, the hotel manager’s vocabulary includes the words ‘occupied’ and ‘free’. How might such words be represented in a class diagram?

A

Two ways come immediately to mind:

  • as an attribute of the Room class
  • as an association between the Room and Guest classes.

Either is acceptable as a way of recording the information.

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

What characterises the state of an object at a particular point in time?

A

The state of an object is characterised by the value of each of its attributes at that point in time.

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

What does an attribute of a class represent?

A

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.

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

What is meant by the multiplicity of an association in a class diagram?

A

A specification of how many objects of one class are related to one object of another class.

24
Q

How are multiplicities between associated classes usually expressed?

A

The general form for multiplicities uses two integers to express the range of allowable values:

minimum..maximum

25
Q

What is the purpose of naming an association between classes with role names?

A

The name you give to one end of an association reflects the purpose or role of the association from the point of view of the class at the other end.

26
Q

What is a navigation expression?

A

A description of the path taken to traverse the links (corresponding to one or more associations) from one object to another object (or set of objects) or to its (or their) attributes.

27
Q

Can more than one association exist between classes?

A

Yes. As a modeller, you will want to represent the structure of the domain. If there are several associations between two classes in your model, you will need to include them all.

28
Q

Does a multiplicity of 1 indicate that there can be no change in the object to which the multiplicity relates?

A

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.

29
Q

If an airline system models flights and pilots, and each flight needs two pilots, would you use a multiplicity of 2?

A

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.

30
Q

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?

A

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.

31
Q

If a model contains role names, do you also need to use association names?

A

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).

32
Q

What is a navigation expression used for?

A

It provides a way of naming another object or its attributes relative to a starting object by referring to intermediate role names.

33
Q

What is a recursive association?

A

A recursive association is an association where both ends terminate at the same class.

34
Q

When considering attributes, what is the effect of moving from a conceptual model to an analysis model?

A

The conceptual model records attributes of classes that will be familiar to a domain expert. For example, a hotel manager will be familiar with the daily rate for a room and whether or not it is occupied. In the analysis model, the developer must consider the representation of attributes within a software system. For instance, daily rates for rooms involve money and you can use a true/false (Boolean) expression to represent the occupancy of rooms.

35
Q

Why is a class model not sufficient to describe a system?

A

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.

36
Q

What is meant by an aggregation association?

A

A relationship between an aggregate class and other classes. An aggregate object is an object which can be thought of as being composed of other objects (components), respectively, instances of the other classes. Some authors consider that the objects that are components in one aggregate object cannot be components in another aggregate.

37
Q

What is meant by a composition?

A

It is a form of aggregation with strong ownership; component objects of an aggregate have no life after the destruction of the aggregate.

38
Q

What is meant by navigability? When is this idea useful?

A

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.

39
Q

In a multi-user operating system, users are allocated passwords. How would you represent this association between a User and Password object in UML?

A

You would use a unidirectional association line between objects with an arrow pointing in the direction of the Password object. This is because Users will want to ‘know about’ their passwords, not the other way round.

40
Q

What is a qualified association?

A

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.

41
Q

What is an association class?

A

An association that also has class properties. Each instance of the association class defines values for those properties. It also imposes the restriction that there can be at most one instance of the association class per pair of objects linked by the association.

42
Q

What is a derived association?

A

In UML, an association that can be computed from one or more other elements. Although it adds no semantic information, it may aid understanding or be useful for design purposes.

43
Q

What is a derived attribute?

A

Similar to a derived association, a derived attributed can be computed from one or more other elements. Although it adds no semantic information, it may aid understanding or be useful for design purposes.

For instance, a Person might have the attributes dateOfBirth and ageInYears. These attributes are not independent – if you were given dateOfBirth, you could calculate ageInYears – so the age could be marked as a derived attribute: /ageInYears.

44
Q

How is a derived association indicated in UML?

A

By preceeding the role (or association) name with a slash.

45
Q

Under what circumstances would you want to show an association that is not independent of others in the diagram?

A

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.

46
Q

What would be a suitable qualified association between a Company object and an Employee object?

A

An payroll number or other unique identifier.

47
Q

What is meant by specialisation among classes?

A

A relationship between classes in the object-oriented model that captures the fact that a child class is a subtype of the parent class, that is, the methods and data fields of the specialised class (subclass) are a superset of the generalised class (superclass specialised class).

48
Q

What is meant by generalisation among classes?

A

A relationship between classes in the object-oriented model that captures the fact that one class of objects is more generalised than another, that is, the methods and data fields of the generalised class (superclass) are a subset of the specialised class (subclass).

49
Q

What is substitutability?

A

Substitutability means that an object of one type is legitimately substitutable for an object of another type. This is allowed in Java when objects are related through inheritance (that is, an object of the child class may be substituted for an object of the parent class). However, substitutability is only sensible when the objects are related as subtype to supertype (that is, when the inheritance is inheritance for specialisation and not inheritance for construction).

50
Q

What is meant by the interface of a class?

A

The interface of a class is the set of operations that specify the service that it provides.

51
Q

What is the difference between inheritance and generalisation?

A

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.

52
Q

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.

A

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.
53
Q

When is an invariant on a class true?

A

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.

54
Q

What are the risks involved when you try to record all the possible constraints on a model?

A

The first risk relates to the complexity of the resultant model. If too many constraints are recorded on a model, that model will become difficult to read or comprehend. For each case you should decide whether or not a given constraint adds value to your particular model. It may be more appropriately recorded in the glossary.

The second risk relates to the potential increase in the number and complexity of any dependencies that would arise for each additional constraint, especially those among two or more model elements.

55
Q

In a model that contains the classes Adult and Child, where each Child has a mother and father that are instances of Adult, what constraints might you impose on relationships between the classes? Express the constraints in English.

A

Every Child must have a mother and father that are instances of Adult. The father cannot be the mother. A father must be male and a mother must be female. Both adults must be older than the child.

56
Q

In the UK, it is a legal requirement that both parties to a marriage are at least 16. Should this be modelled as an invariant?

A

Almost certainly not. A model is meant to express what the case is about rather than what it ought to be about. So unless the domain expert agrees that illegal marriages need not be represented, the model should allow them.

57
Q

How would you model the constraint in a hotel system that every bill must be paid with either a debit or a credit card? How would you extend your model if cash were to be allowed?

A

One way is to use the {xor} notation. However this can relate only two associations. If you need to express a three-way constraint in order to allow for the addition of cash payments, for example, you will have to abandon the graphical notation of {xor} and instead write a textual constraint. Alternatively you could use generalisation to create an abstract PaymentMethod class with an association to the class Bill. Then each payment method, such as debit or credit card or cash, would become a specialisation of the parent, abstract class PaymentMethod.