I just came across a post - Portland’s Best Breweries 2018 and was kinda sad that there was no mention of Migration Brewing :( Not that I am an expert in the field, but I personally think they have a pretty solid lineup of beers. My favorite there of course is - Luscious Lupalin IPA. The post did mention Ecliptic Brewing, another of my favorite! My favorite there definitely is Orbiter IPA.
And back to the unbeering application :)
- Just one improvement for this iteration. The application now only asks to enter an entry for the days that are not already in the journal. I’m assuming journaling began on January 1, 2018.
- I added a static method - GetDatesForMissingEntries which returns a list of dates for entries that are not currently in the journal. This is not an efficient way of retrieving the information we need! Using the current method, we’d first retrieve all of the entries in the database, compare with expected list of entries that should be in the database! Imagine that we are on third year of running this application. That’s moving a lot of data and calculation.
A better solution would be to have this information(missing entries) available to us immediately without any real time querying and calculation. We’ll work on solving this in later posts as this is good enough for time being!
Code for this post is in branch: learning-unbeered-5. Note that there is no learning-unbeered-4! I realized that the title of these posts were one step ahead of the branch name. I skipped ‘4’ to align title of the post with the branch.
- I think we can replace the static class DataStore with something better.
- I’d also like to separate out the logic of storing vs reading entries. Having read vs. write model would make things clearer. Hint: CQRS :)
Until next time!