Comment

Comment by apotheosis

Your typical factory pattern is an example of the OCP; move the part that changes into its own class (a factory). The class that uses the factory is closed to changes, but open to extension (new factory types).

Perhaps it's not the SOLID principles that are bad, but they way you've seen them used? More important than the principles is how they're interpreted and implemented, I think.

parent apotheosis 6 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton