Doubt in class diagram

Asked

Viewed 2,246 times

3

Good afternoon.

Follow the question about class diagram with the diagram I was able to do.

Describe the class diagram for a simple room reservation and occupancy system for a hotel. The system must store reservations made by an employee of one or more rooms for a particular customer. The employee should be able to check if a room is busy or not, enter or change a customer’s data, make a room reservation for a client. Consider the attributes of all classes as private. Each client and employee must have: name, ID, address, telephone. The customer must still have a field which stores the amount of occupations already carried out by it. A room may be simple or luxury and should indicate the number of beds and the type of each of them (single or couple). inserir a descrição da imagem aqui

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

Thank you!

2 answers

1

I would add the "book" method in "Room" taking into consideration "reservations made by an employee" and "make a room reservation for a customer".

0

I would add the following methods:

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

As 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 Room class 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: idCama: int;

Fourth class: idCamas: int; quantCamas: int;


Person: idPessoa: int;

Client: idPessoa: int

Official: idPessoa: int;

And so on and so forth.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.