Classes diagram (analysis)

Steps in the process

  • Step 1: An interface (except alert/notification/warning, confirm dialog…) -> create a view class.
  • Step 2: Consider the elements needed in each interface (review the scenario): naming the element with the prefix of it type:
    • in: for input elements (input text, input date….)
    • out: for output elements (table, content…)
    • sub: for submit elements (button, link…)
    • and may be one combination of these three types.
  • Step 3: Consider whether we need to take some action/function under the view class. For each function needed, try to answer four questions:
    • What is the appropriate name of the method (may naming it by the code convention)
    • What are the input parameters?
    • What is the output parameter?
    • It should be assigned to which class? Consider the following principle:
      • If the output parameter is a kind of an entity class, then the method is assigned to that entity class.
      • If it is not, consider the input parameters. If they include only one entity class, then assign the method to the entity class. If they include more than one type of entity class, then looking in the entity classes diagram, choose the entity class that could contain all input parameters to assign the method.
  • Step 4: Build the classes diagram for the module.

Applying

a. Edit a room

Analysis this module:

  • Enter the system -> The login interface is appeared -> need a calss: LoginView
    • input for username -> inUsername
    • input for password -> inPassword
    • a submit to login -> subLogin
  • Enter the username/password -> the system must check if the login is correct -> need a method:
    • name: checkLongin()
    • input: username, password (of the class User)
    • output: boolean
    • assign to the entity class: User.
  • Once login is successful -> the main interface of the manager is appeared -> need a class: ManagerHomeView which has at least:
    • an option to choose to manage room -> subRoomManage.
  • Choose the option to manage room -> The room management interface is appeared -> need a class: RoomManageView which has at least:
    • an option to choose to edit room -> subEditRoom.
  • Choose to edit room -> The search room interface is appeared -> need a class: SearchRoomView:
    • an input text to enter the keyword (search by room name) -> inKey
    • a search button -> subSearch
    • a result table which could be clicked in to choose a room -> outsubListRoom.
  • Enter a keyword, and click search -> the system has to search all rooms whose name contains the entered keyword -> need a method:
    • name: searchRoom()
    • input: a keyword
    • output: a list of room
    • -> assign to the entity class: Room.
  • The list of founded room will be listed in the SearchRoomView.
  • Click on a room to edit -> the room edit interface is appeared -> need a class: EditRoomView
    • room id: read only -> outId
    • room name: read and editable -> inoutName
    • room type: read and editable -> inoutType
    • room price: read and editable -> inoutPrice
    • room description: read and editable -> inoutDes
    • button to save: submit -> subSave.
  • Edit some attributes and click save -> The system has to update into the DB -> need a method:
    • name: updateRoom()
    • input: an object of Room
    • output: none or boolean
    • -> assign to the entity class: Room.
  • After updating, the system returns to the ManagerHomeView.

b. Booking room

Analysis this module (exclude the login step)

  • Once login is successful -> the main interface of the manager is appeared -> need a class: SellerHomeView which has at least:
    • an option to choose to book room -> subBooking.
  • When a client calls to book room -> the seller chooses the booking option -> the interface to search available room is appeared -> need a class: SearchFreeRoomView
    • input date of check-in -> inCheckin
    • input date of check-out -> inCheckout
    • a button search -> subSearch
    • a table to show the results (clickable) -> outsubListRoom.
  • Enter the check-in, check-out and click on the search button -> The system has to search all available rooms in that period-> need a method:
    • name: searchFreeRoom()
    • input: check-in, check-out
    • out put: list of room
    • assign this method to the entity class: Room.
  • The results are then returned to (and displayed on) the SearchFreeRoomView.
  • The seller chooses a room that satisfies the client requirement -> The interface to search client is appeared -> need a class: SearchClientView
    • input name to search -> inKey
    • button search -> subSearch
    • a list of results -> outsubListClient
    • a button to add new client (in the case of new client) -> subAddClient.
  • Enter the client name to search -> The system has to search all clients whose name contains the entered keyword -> need a method:
    • name: searchClient()
    • input: a keyword
    • output: a list of clients
    • -> assign this method to the entity class: Client.
  • The results are returned to (and displayed on) the SearchClientView.
  • The seller chooses the correct client (in the case of new client, chooses to add new client and the addClientView appeared, that needs a method to add new client into the DB).
  • The confirm interface is appeared -> need a class ConfirmView
    • display all information about the booking -> outBooking
    • a confirm button -> subConfirm.
  • The seller chooses to confirm after having the aggregation from the client -> The system has to save the booking into the DB -> need a method:
    • name: addBooking()
    • input: an object of Booking
    • output: none or boolean
    • -> assign this method to the entity class: Booking.
  • After saving to the DB, the system returns to the SellerHomeView.

c. view the statistical report

Analysis this module (exclude the login step):

  • Once login is successful -> the main interface of the manager is appeared -> need a class: ManagerHomeView which has at least:
    • an option to choose to view report -> subViewStat.
  • Choose to view report -> The interface to config the report is appreared -> need a class: SelectStatView
    • a list to select an object of statistic -> inStatObject
    • a list to select a type of statistic -> inStatType.
  • Select the statistic on the room by the revenue -> The statistic interface is appeared -> need a class: RoomStatView:
    • input start date -> inStartDate
    • input end date -> inEndDate
    • a button to view -> subView
    • a list of all rooms with their statistic -> outsubListRoomStat.
  • Enter the desired start date, end date and click on the view button -> The system has to query all room statistics -> need a method:
    • name: getRoomStat()
    • input: start date and end date
    • output: list of RoomStat
    • -> assign this method to the entity class: RoomStat.
  • The results are displayed on the RoomStatView
  • Click on a room to see the detail -> The interface of detailed statistic on a room is appeared -> need a class: RoomDetailView
    • list bill related to the selected room during that period -> outListBill
    • a back button -> subBack.
  • In order to have the data for displaying on the RoomDetailView, the system has to query all bills related to the room during that period -> need a method:
    • name: getBillbyRoom()
    • input: start date, end date, and the room id
    • output: list of Bill
    • -> assign this method to the entity class: Bill.