Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipes - Tanisha - Hotel #37

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open

Pipes - Tanisha - Hotel #37

wants to merge 62 commits into from

Conversation

tanham
Copy link

@tanham tanham commented Sep 11, 2017

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a design decision you had to make when working on this project. What options were you considering? What helped you make your final decision? When initially designing the project, my team and I came up with a design that involved writing the reserve_room and access_reservations methods in the Reservation class. After thinking more about and writing some code, I realized that the Reservation class only had to be in charge of the attributes and behaviors of a single reservation and the Hotel class can take care of the rest. I thought about like the Reservation would not make a reservation but a Hotel would make a reservation.
Describe a concept that you gained more clarity on as you worked on this assignment. During this project, I really got a chance to understand and practice classes and objects. More specifically, I have a better understanding of giving classes one job.
Describe a nominal test that you wrote for this assignment. In the overlap? method, I tested to see if checkin and checkout dates overlap.
Describe an edge case test that you wrote for this assignment. In the DateRange class, I tested to make sure an invalid date was not being passed in.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? With one or two exceptions, I followed the exact pattern of writing pseudocode, writing tests, and then writing code.

@PilgrimMemoirs
Copy link

Hotel

What We're Looking For

Feature Feedback
Baseline
Used git regularly Well Done
Answer comprehension questions Well Done - Great catch on how to work with the Reservation class and adjusting your design!
Design
Each class is responsible for a single piece of the program Mostly Good - See notes on the Block class below
Classes are loosely coupled
Wave 1
List rooms
Reserve a room for a given date range Well Done
List reservations for a given date Almost - see note on access_reservation below
Calculate reservation price Well Done
Invalid date range produces an error Well Done
Test coverage Well Done
Wave 2
View available rooms for a given date range Mostly Good - Is for a single date, not a range
Reserving a room that is not available produces an error Not complete - see note on reserver_room below
Test coverage Well Done
Wave 3
Create a block of rooms Needs improvement - See note on create_block below
Check if a block has rooms ❗️ Missing
Reserve a room from a block ❗️ Missing
Test coverage Well Done
Additional Feedback
Block Class
Composition between block and hotel class Do you want to create a new hotel for every block? If the idea is that a hotel can have many blocks, then each block shouldn't have a new/unique hotel. When we see that a single hotel should have many blocks, that reads to me that an instance of Hotel should have a collection of blocks. A more appropriate approach, with block as a class, is to store instances of all the blocks that belong to a hotel as a collection in that hotel object. That will make it easier, down the line, to perform functionality such as as checking that a room isn't already reserved for another block and being able to make a reservation for that block.
create_block method The method accepts an argument of 'rooms', however the first line of the method overwrites that variable with an empty array. So it ends up not using any rooms given to this method. The method doesn't check that rooms aren't already part of another block for that same hotel.
Hotel Class
access_reservations method While you're iterating over reservations, you're adding to the same collection you're iterating over if the dates match. Meaning you are still returning all the reservations instead of just the ones that land on that date. Instead, make a new array, before you iterate, that you will add valid reservations to.
reserve_room method This method is checking the @available_room_nums array, however, values are never being adding to that array when making a reservation. When a reservation is being made, you also need to add the number to that array. But then you would also have to ensure that that number is removed at the end of the reservation. Another approach is to iterate on reservations directly to check if the room and dates are already there. - Another observation, It looks like this method would depend on view_available_rooms method to be ran before in order to update the available_room_nums array. If that is case, can view_available_rooms method be utilized within the reserve_room method? Are the @available_room_nums and @available_room_nums attributes necessary if they both rely on a method to always update them?
Etc.
Testing Be mindful of what you're testing and the description you give that block, ex: Hotel's "Has one element" is actually testing with two elements. Block's "Responds to date_range variable" is testing two things, responding to date_range and that the block_rooms is an array - should be split into two tests. I Blocks' "Returns an array", are the lines with hotel and the reservations making any impact on what is being tested?
Class naming conventions Names should be singular, and should not have 'class' in the name. Instead of HotelClass, have Hotel. Instead of Blocks, have Block.
Areas of Concern
The submission, as it, does not meet all expectations for this project. The following list are areas of improvement to meet the learning goals. These would be good to go over on your own, then during your 1-on-1 to ensure understanding of these concepts.
1) Composition of Block class with Hotel. (Creating new instance of Hotel in Block's initialize vs Hotel tracking a collection of Block instances).
2) Logic of the following methods: create_block, access_reservations,
3) Essential functionality of Block class missing (Rejecting a block being created if a room already exists in another block, specifying specific rooms to belong in a block, check whether a given block has any rooms available, reserve a room from within a block of rooms)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants