develpreneur podcast

Granular Interfaces – How Much OO Is Practical?

The ideas of cohesion and coupling point us to paths that either place functionality in smaller or larger classes.  We discuss granular interfaces in this episode as an introduction to those “right-sizing” discussions.  Not all OO designs are created equal. Granular Interfaces – Bricks or Sand The best example I have come across in considering how to approach our design’s granularity is comparing sand to bricks.  We can construct a building by starting from sand, making blocks of concrete, and... Read more

develpreneur podcast

Inheritance – Polymorphism In A Hierarchical Manner

We switch gears in this episode and start to look at inheritance.  This is a core feature of object-oriented design and the most recognizable attribute.  Child classes are utilized through polymorphic support.  Thus, we have a natural transition into this popular usage of object-oriented solutions. A Lowest Common Denominator We have discussed the idea of building on methods where possible.  When we do, we are creating a lowest common denominator approach to functionality.  This is what makes a system logical... Read more

develpreneur podcast

Interfaces – An Object-Oriented Contract For Usage

This episode, we look at interfaces.  These are not supported by all languages.  However, when they are supported, they are very useful.  The interface specification allows us to provide language-based constraints for our method signatures.  It also is an excellent way to enforce consistancy. Interfaces As A Tool For Consistency The most important result of using interfaces is that they enforce a consistent way to communicate with developers.  Any class that uses one of these items will be forced to... Read more

develpreneur podcast

Flexibility in OOP – Build in hooks for change

One of the essential concepts to understand is flexibility in OOP.  A good design requires the ability to extend it.  There are ways to do this.  However, they require us to incorporate mechanisms for validation and growth.  That means we need to find a balance between the core to our functionality and what can be altered as an enhancement. Flexibility in OOP – Many Options There are multiple ways to build flexibility into your object-oriented design.  We can use parameters... Read more

develpreneur podcast

Code Consistency – Critical For Practical Polymorphism

One of the challenges of good polymorphic design is code consistency.  We are building a way to communicate with developers.  Therefore, our language or syntax needs to be easy to understand.  Likewise, we need to set and meet expectations properly. Code Consistency In Results The most common error I find in this area of coding is found in the values returned.  When we stick to native types and numbers, it tends to be easy enough to stay consistent.  However, strings... Read more

develpreneur podcast

Polymorphism Without Side Effects – Object-Oriented Clarity

We discussed in the previous episode how polymorphic behavior gives us a form of a common language for objects.  Thus we need to consider the idea of polymorphism without side effects, so we have clear and concise commands.  There is also a consistency required for this to be an approach that is truly useful. What Is Polymorphism Without Side Effects As always, we should start with a definition of terms.  In this case, our goal is clarity.  Polymorphism is a... Read more