Professional Documents
Culture Documents
-1-
context getStudent(dni: String): Student
pre 1.1: exists some student with dni
pre 1.2: the student is not yet enrolled in any course
post 2.1: result = instance of Student with that dni
Finally, the team of graphical designers has designed the GUI shown in the figure below.
We may notice that the student is identified by its fiel dni in a field text (named dni, (A)).
There is a combo box that contains the enrolment potential set (named Potencial, (B)),
from which the courses are selected one by one (by clicking on the arrow) and then
translated into the list of courses already registered (named Matrícula, (C)). The
accumulated price is shown in a numeric field (named preu, (D)). The ranking is shown in
a numeric field (named rànquing, (F)) once the buttong <<OK>> is pressed. There is a
message area (E). The operation can always be cancelled by pressing <<CANCEL>>.
OK Cancel
-2-
Last, let’s assume that the courses that are being enrolled become persistent (i.e., they are
stored in the data base) as soon as the student selects them. We ask for (1) write the
concrete use case; (2) if necessary, modify the behavioural model according to these
changes; (3) justify the assignment of responsibilities to layers according to the
predominant pattern Domain Model; (4) write the contracts of the Presentation Layer; (5)
write the contracts of the Domain Layer; (6) apply the normalization process to the
Domain Layer; (7) write the contracts of the Data Layer; (8) complete the sequence
diagrams for the relevant presentation events.
2. ...
-3-
:Teacher :System
OK KO
<<Message area>>
(g) Repeat the same use case considering that the students, in addition to the dni, have
a name that is NOT an identifier. Then, assume that the system shows in <<A>>
not dnis but names of students and, in case there is more than one student with the
same name, if this name is selected, an auxiliary combo box will appear with one
entry for each student with that name, together with the dni, and then the teacher
selects again.
4. ...
-4-
1. The System indicates this situation
2. The use case ends
not-interested-in: The reader is not interested in any category (3)
1. The System indicates this situation
2. The use case ends
no-news-are-good-news: There is not any headline in the categories the reader is interested in (3)
1. The System indicates this situation
2. The use case ends
Integrity constraints: name is key of Reader, name is key of Category, headline is key of News
:Reader :System
getHeadlines(nameR): Stit + reader
Let’s suppose that the external design of the GUI works as follows: (1) the reader enters
her name in a text field and presses OK; (2) the system creates a combo box with all the
headlines of the news belonging to the categories in which the reader is interested; (3) the
reader selects one; (4) the system shows in two text fields the headlines and the body of
the selected news. You may use an error area for messages. Design the use case Read
News using Domain Model as dominant pattern.
-5-
vehicle-not-exists: There is not a vehicle with the given plaque (1)
1. The System avisa a l’Administrador that there is not a vehicle with that plaque
2. The use case ends
already-said: The System already knows that someone had used that vehicle in that date (1)
1. The System warns the Administrador that someone had used that vehicle in that date
2. The use case ends
Integrity constraints:
- Keys: (Person, name); (Vehicle, plaque); (Date, date)
- The user of a vehicle must be its owner or must have his/her authorization
- A person cannot authorise him/herself
:Administrator :System
-6-
pre: exists a person nam
pre: exists a vehicle plaq
post: records an usage of the vehicle plaq by the person nam in the date today()
post: result = number of accumulated uses of the vehicle plat
:User :System
allMyVehicles(nam): pers+Splaq
Plaque Reason
Users
Total
OK Cancel
Error area
i) The administrator enters the plaque of the vehicle and then the combo box
<<B>> is filled with the name of the users authorised by the including in first place (and
selected by default) the owner him/herself. The administrator selects the user and gives a
reason, and finally confirms or cancels.
ii) Now assume that the system, first of all, presents a combo box <<F>> with the
list of all the official vehicles since it has been observed that they are the most used. The
administrator has the option of selecting a vehicle from <<F>> or else to input the plaque
in <<A>> as before. Analyse the impact of this alternative over the solution (i) above.
iii) The same as before, but now the system shows in that combo box but the 10
most used until the moment.
b) Do the same for the second use case.
-7-
i) Assume the external design below, where the information flows corresponds
basically to the one in the essential use case:
Vehicles Date
OK Cancel
Error areas
8. …
9. ...
10. ...
-8-
11. (Examen final ES2 Juny 07) ...Done at the classroom.
12. (Examen parcial ES2 Nov. 06) Consider an Information System for managing
orders. The buying companies establishes agreements with the services delivered by
supplier companies in a given date dateA. They also may place orders in a certain date
dateO. In a given moment (dateP) the dates become planned, with a supervisor assigned
that earns some given money. When the order is closed, it may be the case that some of its
products are still missing (lack of stock, for instance). The system also registers the tax
that the EC imposes on these transactions, in a form of percentage (e.g., 17%). Here you
have the specification:
Integrity constraints:
RT1. Keys: (Company -> nif), (Product -> code), (Supervisor -> dni), (Order -> codeC)
RT2. A buying company cannot place more than one order in the same data.
RT3. The products that compose an order must be supplied by some supplier company that has an
agreement with the buying company that places the order.
...other constraints not relevant for the problem
Derived information:
ID1. /nbord = number of orders of the company
ID2. /nbClosedOrd = number of orders closed made by the company
-9-
Consider a use case New Order with the behavioural model:
: Administrator : System
createOrder(nifC, codeO, dateO): ord
endOrder(ord): totalPr
a) propose a external design for the use case according to the conditions stated below
b) modify the behavioural model according to this external design
c) provide the contracts of the operations that belong to the domain model
d) show which presentation events invoke which operations in the domain layer
e) apply the normalization process to the data conceptual model, materializing the
derived information
Conditions. Your solution should promote that the presentation layer assumes as much
responsibilities as possible. Assume that the data is made persistent as it is communicated
to the system
15. (Examen parcial ES2 Des. 05) An Orchestra is an aggregation of Musicians that are
specialist in some instrument:
Musician Orchestra
* 0..1
name: String name: String
instr: String belongs /nbMembers: Int
- 10 -
CreateOrchestra BigOrchestras
: User : System : User : System
newOrch(nameO)
bigOrch(quant): Int
loop newMusic(nameO, nameM)
nbMusics(nameO): Int
Let’s assume that, once done the assignment of responsibilities to layers, the contracts of
the domain layer operations are:
context newOrch (nameO: String)
exc 1. There is already an orchestra with name nameO
post 2. Creates a new Orchestra with name nameO and without members
context newMusic (nameO: String, nameM: String)
pre there is some orchestra with name nameO
pre there is some musician with name nameM
pre the musician nameM is not assigned to any orchestra
post 2.1 links the orchestra nameO and the musician nameM
2.2 increments nbMembers of the orchestra
context bigOrch (quant: Int): Int
post 1. result = number of orchestras that have nbMembers > quant
Let’s assume that for some reason the navegability is predefined from Musician to
Orchestra. Assume also that the derived information is materialized.
- 11 -
Show a external design that matches with the domain layer specification given. Create the
sequence diagrams that correspond to the relevant presentation events, showing the three
layers. If you think that some responsibility is missing in some of the contracts given, you
may ad dit, but you cannot add new operations, just new pre/exc/post in the contracts.
- 12 -