mardi 23 octobre 2018

How to apply Design Patterns from Use Case

I need to solve an exercise for the university. The exercise is about the the application of design patterns from real scenario. From an use case I have to draw UML class diagrams exploiting different design patterns. I don't understand the steps to follow to rich the purpose.

This is my approach:

1) I read the use case

2) I extract from it all explicit entities with their attributes

3) I sketch an UML class diagrams with previous information

4) I add some classes which is not mentioned in the use case but it's necessary, such as classes for the collections.

5) At this point I analyze if is useful the use of a specific pattern and draw the final UML class diagram.

This is my problem:

SCENARIO:

A software system must manage the assignment of classrooms for university course exams. The classrooms are located in different plexuses. Each plexus contains 10 to 20 classrooms. Each classroom of a plexus is identified by a name, by the plane in the plexus, by a number progressive with respect to the plane and is characterized by the number of available places in it and by a state (free, reserved, occupied) with respect to a date and a schedule. Each classroom can be equipped with different types of teaching tools (eg blackboard, projector, projection screen, computer, network connection, test benches). The exams are related to the teachings of a university course. Each exam session held in a classroom is characterized by the day of the session, the teaching and the timetable. Each lesson is held by the teacher, belonging to the course of study which belongs to the teaching of the lesson, identified by the surname of the name and type of teacher (ordinary, associate, charge). The reservation is made by the teacher in charge of the course. The teacher in the reservation indicates the date and time of the exam, the teacher, the expected number of candidates for that session, any necessary teaching tools. The administrator of the classrooms is responsible for processing requests for classrooms for the maintenance of exam sessions as reported in the following use case.

Use case: classroom assignment for exams

Actor: administrator classrooms

Description:

  1. The system displays a form with the list of unanswered requests for classrooms for exams made by the various teachers; the list is sorted in ascending order with respect to the date and time of registration of the request. The list shows the name of the teacher, the name of the course, the date and time of the beginning and the end of the exam session, the expected number of candidates for that session.
  2. If the list is empty, the message "There are no requests for reservations" is displayed and the use case ends.

  3. If the list is not empty, the actor selects the request at the top of the list.

  4. The system displays a list of the free classrooms with a number of places adequate to that of the candidates scheduled for the date and times indicated in the booking request. This list shows the name of the plexus in which the room is located, the number of the floor in the plexus, the progressive number of the room relative to the floor, the number of available places in it, its status with respect to the date and time indicated in the reservation request. The list is sorted in ascending order with respect to the number of classroom seats.

  5. If the list is empty, the system displays the message "No room available for the indicated date and time", the list scrolls in one place and the use case continues from point 3);

  6. If the list of available classrooms is not empty, the system proposes, by highlighting in bold the respective lines of the list, the classrooms with a number of places equal or close to that of the expected number of candidates for that session.

  7. The actor selects the room corresponding to one of these lines (but can also select a room that does not correspond to one of the lines in bold).

  8. The system asks the actor to confirm the selection.

  9. If the actor confirms the selection, the system:

    a. register the room reservation on the date and time required for the exam session of the teacher's teaching, reporting the date and time when the booking is registered,

    b. sets the status of the selected room equal to "booked" for that date and time

    c. it sets the status of the booking request to "evasa"

    d. records a notification to the teacher of the reservation made with indication of the room booked for the exam session specified in his reservation request.

  10. If the actor does not confirm, the system asks the actor sc to select a different classroom or if he wants to end the use case.

  11. If the actor indicates he wants to make a new selection, the use case continues from point 7), otherwise the use case ends.

  12. The system updates the list of reservation requests displayed, deleting the list just completed, and the use case continues from point 1) until the list is empty.

  13. The use case ends

The candidate designs a UML Design Class Diagram defining the classes necessary to realize the use case, showing all the components (of the application domain, for interaction with the user, and for the management of persistent data) constituting the static structure of the software to be implemented (explicitly indicate any architectural pattern c design that should be used, motivating the choices). In particular, the candidate indicates which design pattem he intends to adopt

MY PROCESS

1) I read the use case

2) I extract from it all explicit entities with their attributes

ENTITIES

classroom, tool, plexus, state, teacher, teaching, course, exam, reservation

3) UML

uml

4) I can add classes for collections the list of classrooms, exams, reservation

5) I can use The SINGLETON DP for the classes on point 4

I can not continue I'm stuck. You could help me? My English is bad I hope it was clear.

Aucun commentaire:

Enregistrer un commentaire