Know your design tools — The Performing Half-baked object case

Marco Dorantes
2 min readJun 27, 2021
The Performing Half-baked object

Among other important paradigms in software design, object orientation is a common set of design techniques these days. Hierarchies of classes, derivative class instantiations and virtual calls can be often found on software codebases. Hence, the relevance of the Performing Half-baked object case while designing object-oriented software.

The Performing Half-baked object case occurs where a virtual call is executed onto an unborn or uncreated or uninitialized class instance: the actual behavior can be unexpected, of course.

A couple of examples (code as text here).

Consider the output of this Windows/Visual C++ code:

Windows/Visual C++ version of the Performing Half-baked object

For another –different– behavior, consider the output of this .NET/Visual C# code:

.NET/Visual C# version of the Performing Half-baked object

The Performing Half-baked object is a case that designers of object-oriented languages and runtimes have typically faced. Any designer using those languages and runtimes should be aware of this and other cases during the process of object creation.

--

--

Marco Dorantes

Reflective software craftsman and systems thinking enthusiast.