Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
6 posts found #inheritance
Template Method Pattern: Algorithm Skeletons, Hooks and the Delegate-Based Alternative
Software Design PART 22

Template Method Pattern: Algorithm Skeletons, Hooks and the Delegate-Based Alternative

Template Method fixes an algorithm's skeleton in a non-overridable base class method and leaves the varying steps to abstract methods or empty hooks. The hook silently skipped by a forgotten override (CS0114), Stream.CopyTo and BackgroundService.ExecuteAsync whose behavior changed in .NET 10, the virtual-call-in-constructor trap (CA2214), and building the same flow with delegates through composition.

7 Nov 2026 13 min 7
Composition over Inheritance: Fragile Base Class, Delegation and Pluggable Behavior
Software Design PART 09

Composition over Inheritance: Fragile Base Class, Delegation and Pluggable Behavior

Inheritance ties a subclass to its base class's implementation details, so a harmless change in the base class can silently break a subclass, while composition and delegation depend only on the contract. The fragile base class problem shown with real output, the class explosion when behavior grows along two axes, and where inheritance is right: Collection<T> hooks and sealed.

7 Nov 2026 13 min 3
Polymorphism in C#: virtual, override, new and Abstract Classes
Backend PART 06

Polymorphism in C#: virtual, override, new and Abstract Classes

Letting the runtime decide with virtual and override, an if-free cart loop for shipping costs, base calls and overriding ToString, hiding with new and the CS0114 trap, abstract classes and the template method, sealed override and the NullReferenceException of calling a virtual method from a constructor.

7 Nov 2026 10 min 9
Inheritance in C#: base, sealed and the Constructor Chain
Backend PART 05

Inheritance in C#: base, sealed and the Constructor Chain

Inheritance with Product, Book and EBook: what a derived class sees and protected, the constructor chain with base and the reverse order of field initializers, upcasting, downcasting, is and as, stopping derivation with sealed, and how an Order derived from List breaks encapsulation.

7 Nov 2026 11 min 8
What's New in EF Core 7: ExecuteUpdate, ExecuteDelete, JSON Columns and TPC
Database PART 25

What's New in EF Core 7: ExecuteUpdate, ExecuteDelete, JSON Columns and TPC

ExecuteUpdate/ExecuteDelete, ToJson for owned types in JSON columns, TPC inheritance, IMaterializationInterceptor, FromSql and SqlQuery<int> in EF Core 7, plus moving from EF Core 6 with breaking changes like Encrypt=True and HasTrigger.

5 Nov 2026 10 min 22
Inheritance Mapping in EF Core: TPH, TPT and When to Choose Which
Database PART 19

Inheritance Mapping in EF Core: TPH, TPT and When to Choose Which

How does EF Core turn a class hierarchy into tables? We compare TPH with its discriminator column and TPT with a table per type using real SQL output, and look at silent pitfalls like a subclass missing from the model.

5 Nov 2026 12 min 19
Blog Map