Doubt in class diagram

3

Good afternoon.

Here's the class diagram question with the diagram I've been able to do.

Describe the class diagram for a simple system of reservation and occupation of rooms to a hotel. The system must store reservations made by an employee of one or more rooms for a particular client. The employee should be able to check if a room is busy or not, insert or change the data of a client, make the reservation of a room to a customer. Consider the attributes of all classes as private. Each client is The employee must have: name, address, telephone. The client must still have a field that stores the amount of occupations already performed by him. A room can be simple or luxury and should indicate the number of beds and the type of each (single or double).

Is the representation correct? I had great difficulty adding the methods, which I added in the Client and Room class are correct? Are there others to add?

Thank you!

    
asked by anonymous 11.04.2017 / 19:53

2 answers

1

I would add the "book" method to "Room" taking into account "reservations made by an employee" and "booking a room for a customer".

    
18.01.2018 / 01:59
0

I would add the following methods:

  • in class Client: insertClient (), changeClient ();
  • in class Room: book ();
  • in the Employee class: insertFunctional (), registerFunctional (); (although it is not written, you will need to register the employee as well.)

For attributes, when you indicate that one class is related to another it means that some field between classes is related. So for example, in the Class Room you do not indicate that she will have information about the bed, only that the bed class has a one to many relationship with her. Using this example, I would add the following attributes:

Bed Class: idCame: int;

Room category: idCamas: int; quantCamas: int;

Person: idPessoa: int;

Customer: idPerformance: int

Employee: idPessoa: int;

And so on.

    
01.05.2018 / 20:05