Object-Oriented Design: Binary or Enum?

BLUF

Some aspects of a problem are superficially binary, perhaps modeled as a boolean value.

Don't be misled. Some aspects of a problem are clearly not binary, and a boolean is wrong. Other aspects may or may not be binary, and a boolean might not be ideal.

Clearly Not Binary …

more ...


Legacy Software is a Sticky Mess

I'll get to legacy software. First, however, some backstory on observability.

Sailors will sometimes create "Float Plans". Like aircraft flight plans, they have an itinerary to make it slightly easier to find us when something goes wrong. Unlike airspace, which is tightly controlled by the FAA, the seas are more-or-less …

more ...

Architectural Boundaries: Which Package/Module/Class Owns That Responsibility?

The SOLID design principles beat the design boundary issue to death. Here are the principles in my preferred order. (See https://www.linkedin.com/learning/learning-s-o-l-i-d-programming-principles)

  1. Interface Segregation -- minimize the boundaries. Do this first.
  2. Liskov Substitution -- keep the boundaries consistent. Do this for hierarchies.
  3. Open/Closed -- keep the boundaries stable …
more ...




Eager and Lazy Properties

See this

Dear Pythonista lazyweb: If I have a property spam and the attribute that backs it is _spam, what do we call that? The "backing attribute"? The "original property"? Something else? Is there an official term for this?

—Al Sweigart (@AlSweigart) January 29, 2019

My answer was -- frankly -- vague …

more ...