Pages

October 10, 2020

10/10/2020: Keeping an open mind is hard; Abstract Factory Design Pattern

TIL: Politics are hard. Keeping an open mind in today's political climate is even more difficult. 

TIL: We elect judges so the courts aren't stacked against the majority by whomever happens to be in power when the seats become available (like what is happening with the Supreme Court right now). I never put the two together before, and also didn't realize not all states elect judges. 

TIL: Abstract Factory design pattern.

------------------------------------------------------------------------------------------

I've always leaned liberal in the political spectrum, and while I most often vote Democrat I've never considered party a hard and fast line at the ballot box. Specifically for all the court appointees, I try to discover what type of rulings and/or arguments the candidates make. Not always easy with so much rhetoric flying around, which is why I set aside several hours to go through and research the ballot prior to voting. 

I know judges are supposed to be non-partisan. For this November 3rd election however, I find I'm heavily prejudiced against Republicans simply because they are associated with our current president. I never actively wanted someone to die - until I heard the president has COVID. Wanting someone dead has always been my definition of hate, and until this past week I didn't realize I was capable of hating anyone. Not proud of it, but I'm also not proud of a country willing to ignore and/or validate and venerate blatant mysogyny and discrimination. 

I don't really want him to die. I just want him to go away, and I'm frightened he will refuse to do so even if we vote him out of office. 

------------------------------------------------------------------------------------------

The Abstract Factory design pattern is in the Creation category, and is used when code needs to work with a variety of related objects. Instead of creating a concrete class for each variety, the factory provides interfaces. This makes it easy to add or remove object variants without having to change the code. It also allows for simpler code by treating all similar objects the same.  

In a well-designed program each class is responsible only for one thing. If your class is trying to handle similar types of the same thing, consider extracting the methods relating to those types out into a factory class or Abstract Factory interface. 

------------------------------------------------------------------------------------------

Today's accomplishments:
21K+ Steps
Watch The Masked Singer
Wash kitchen rug
Clean 1st floor bathroom
Grocery Shopping
Start ToDo lists for the next 3 days
Sweep kitchen
Dishes
Make and freeze spaghetti
Research and fill in mail in ballot
Research Abstract Factory Design Pattern
Complete the next module of Thinkful Javascript course
Watch Critical Role campaign 2 episode 88
Stretch
Print Chris/Craig photo for painting

No comments: