11 articles

Building a generic ValueObject<T> base class in C# — implementing IComparable, IEquatable, operator overloads, and an implicit conversion operator to eliminate primitive obsession.

Mirroring a third-party class hierarchy in your own wrapper layer using a generic IWrapper<T> interface implemented twice — preserving the parent–child relationship for typed collections.

Extracting controller action logic into a dedicated command class that inherits Controller — giving it full access to HttpContext, View(), and routing without a wrapper property.

Using custom C# attributes and reflection to tag filter classes with their data type category — eliminating duplicate definitions and enabling a self-registering dictionary pattern.

The factory pattern decouples object creation from consumers using a factory method interface — adding new types requires only a new class, not edits to existing switch statements.

Wrapping ExternalEvent and Transaction in a custom IRevitActionHandler interface that works in both a live Revit add-in and a plain WPF test project without Revit context.

The bridge pattern decouples abstraction from implementation so both can vary independently — illustrated with shapes holding color references instead of inheriting them.

The memento pattern captures an object's state for later restoration using three actors: Originator, Memento, and Caretaker — the foundation of undo/redo.

The adapter pattern bridges incompatible interfaces by wrapping an adaptee in a class that implements the target interface — illustrated with an old gas-car adapted to an electric-car interface.