Skip to content

Sockets - Pauline#30

Open
paulentine wants to merge 37 commits intoAda-C11:masterfrom
paulentine:master
Open

Sockets - Pauline#30
paulentine wants to merge 37 commits intoAda-C11:masterfrom
paulentine:master

Conversation

@paulentine
Copy link
Copy Markdown

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What was a design challenge that you encountered on this project? Coming up and deciding on an overall design for the project was a challenge on its own. I found myself going overboard attempting to practice Sandi Metz' principles to the design of this project, and kept going back and redoing my design.
What was a design decision you made that changed over time over the project? Initially, I instantiated 20 rooms upon instantiation of Hotel (similar approach to Deck - Cards). This instantiation was then decoupled and postponed until necessary: when a Reservation needs to be made. At the end, this proved needlessly complicated for the scope of this project, and I returned to my initial approach of instantiating all 20 at once.
What was a concept you gained clarity on, or a learning that you'd like to share? That at some point, it is better to commit to one design (while noting where things are tightly vs loosely coupled), complete it, and refactor it at the end; as opposed to fighting endlessly with my prior days' self over design decisions.
What is an example of a nominal test that you wrote for this assignment? What makes it a nominal case? I wrote nominal tests to test that booking gets assigned correctly to a room that does not have prior reservation on a given date range. This is a nominal case as it is testing for a normal behavior that is supposed to happen on a regular basis.
What is an example of an edge case test that you wrote for this assignment? What makes it an edge case? An edge case counterpart is testing to see if that booking gets assigned correctly, given that the room has a prior reservation ending on this booking's checkin date. This is an edge case as it tests for something that may cause false negative if our code was not properly tailored to account for such case.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? This workflow feels very comfortable, especially with the tests as sanity check for this CLI-less program: that I am indeed writing what I intend to write.

…are now instantiated when Hotel is instantiated. Tests not yet updated.
@dHelmgren
Copy link
Copy Markdown

Hotel

What We're Looking For

Feature Feedback
Baseline
Used git regularly yes
Answer comprehension questions I appreciate your comment about needing to commit to a design: it ain't easy

Design |
Each class is responsible for a single piece of the program | Yes
Classes are loosely coupled | Relatively
Wave 1 |
List rooms |
Reserve a room for a given date range | Yes
List reservations for a given date | yes
Calculate reservation price | yes
Invalid date range produces an error | yes
Test coverage | 100%
Wave 2 |
View available rooms for a given date range | Yes
Reserving a room that is not available produces an error | yes
Test coverage | 100%
Wave 3 | DNF
Create a block of rooms |
Check if a block has rooms |
Reserve a room from a block |
Test coverage |
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
Additional Feedback | It's okay that you didn't hit wave 3, but know that you take a lot of time when you design as you move forward! This is especially important when you design your capstone, as you have a lot of work with those and only a month to make it work.

Comment thread spec/room_spec.rb
@jan3 = Date.new(2020, 1, 3)
@jan4 = Date.new(2020, 1, 4)
@jan5 = Date.new(2020, 1, 5)
@test_res = @test_hotel.new_reservation(@test_room, @jan2, @jan4)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These dates are a little to close together. How will you test that a range is completely contained when your res will have to start or end on the same day?

Comment thread lib/room.rb
STANDARD_RATE = 200

module BookingSystem
class Room
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Big design thought: What do you get from a Room that you couldn't get from a Hash of Arrays?

This implementation is totally valid, but it's an interesting thought exercise!

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