Skip to content

Conversation

@tofuandeve
Copy link

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What was a design challenge that you encountered on this project? Deciding what should be a class and what should not. And how much information a class should know
What was a design decision you made that changed over time over the project? At first, checkin and checkout date were string values, but I decided to change these values to be Date object instead. And I created a Room class which would hold the information of a room number and a list of reservations of itself, but later removed this class as an effort of refactoring my HotelSystem.
What was a concept you gained clarity on, or a learning that you'd like to share? The dependency of one class on the others in Object Oriented Design. It is important to understand these dependencies in my class, so that I can manage them when ever there is a change to be made inmy design
What is an example of a nominal test that you wrote for this assignment? What makes it a nominal case? A user of HotelSystem can create a hotel block for valid input (valid date range, valid list of room, valid discount rate)
What is an example of an edge case test that you wrote for this assignment? What makes it an edge case? A user of HotelSystem cannot create a hotel block for invalid input where a list of room has duplicate/ non-existent room in it
How do you feel you did in writing pseudocode first, then writing the tests and then the code? I spent athe first day to write pseudocode and simplify my pseudocode many times so that my design does the simplest things possible, with the least variables possible. Then I created empty classes with method signatures, then wrote tests for each method so that I can shape each class' behavior. I also started from the simplest class that has the least dependency on other classes (in order: DateRange, Reservation, HotelSystem).

@tildeee
Copy link

tildeee commented Sep 16, 2019

Hotel

What We're Looking For

Test Inspection

Workflow yes / yes but no test / no
Wave 1
List rooms yes
Reserve a room for a given date range yes
Reserve a room (edge case) yes
List reservations for a given date yes
Calculate reservation price yes
Invalid date range produces an error yes
Test coverage yes
Wave 2
View available rooms for a given date range yes
Reserving a room that is not available produces an error yes
Test coverage yes
Wave 3
Create a block of rooms yes
Check if a block has rooms yes
Reserve a room from a block yes
Test coverage yes

Code Review

Baseline Feedback
Used git regularly yes
Answer comprehension questions yes
Design
Each class is responsible for a single piece of the program yes
Classes are loosely coupled yes
Fundamentals
Names variables, classes and modules appropriately yes
Understanding of variable scope - local vs instance yes
Can create complex logical structures utilizing variables yes
Appropriately uses methods to break down tasks into smaller simpler tasks yes!
Understands the differences between class and instance methods yes
Appropriately uses iterators and Enumerable methods yes
Appropriately writes and utilizes classes yes
Appropriately utilizes modules as a namespace yes
Wrap Up
There is a refactors.txt file yes
The file provides a roadmap to future changes yes

Overall Feedback

Great work overall! You've built your first project with minimal starting code. This represents an incredible milestone in your journey, and you should be proud of yourself!

Eve, your submission for this project is fantastic-- your code is clean, intentional, well-thought out, and planned. Your attention to detail (like checking that reservation cost comes back as a formatted string) really shines in this project. Your naming of methods and variables, ease of Enumerables methods, and clean code-style show me how much you know! Also, the way your classes are organized, and your best practices like private helper methods and regular raising of exceptions shows me how much you know about design.

Above all, your tests are amazing! I'm really happy with how well-written your tests are. They cover things accurately and thoroughly, and are so easy to read. I think you did a great job with the tests! I hope you continue to write great tests like this!

I have some small minor suggestions and comments on your code. Also, just as an FYI, about IDs: when we get to Rails, let's see what our strategy will be about giving IDs to objects when we save them in a database! Just something to look forward to :)

Overall, you did a great job on this project. Keep up the great work!

@end_date = input_end_date
current_time = Date.today()

if (@start_date < current_time) ||
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice touch!

blocked_rooms = find_overlapping_rooms_in_hotel_blocks(date_range)
available_rooms = @rooms.select do |number|
!has_overlapping(@room_reservation_data[number], date_range) &&
!blocked_rooms.include?(number)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This select is clever!

start_date2 = @end_date
end_date2 = start_date2 + @duration
@hotel_system.make_reservation(start_date2, end_date2)
expect (@hotel_system.reservations.length).must_equal @number_of_reservations + 1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice case to test!

start_date = Date.parse(start_date_data[index])
end_date = Date.parse(end_date_data[index])
@hotel_system.make_reservation(start_date, end_date)
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This is a clean setup step!

end
end

it "returns nil for a nonexistent reservation" do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

end
end

describe "available_rooms_in_block method" do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick: This should probably be named something else

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I missed this line. It should be "reserve_room for rooms in block"

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