Skip to main content

From Layers to Microunits

The evolution of “Code Cohesion” and “Separation of Concerns”

The software industry has recognized the values of “Separation of Concerns” and “Code Cohesion” for more than two decades. Many articles, books and software-thinkers have contributed methodologies to implement these important values.

In this short article I’d like to compare the conservative “Layers” solution with a new approach, which I call “Microunits”, that can open new ways of solving software design challenges.

Read more...

Comments

The Best

GetHashCode Hands-On Session

The following is a hands-on post meant to demonstrate how GetHashCode() and Equals() methods are used by .NET Framework under the hood. For the sake of simplicity I will refer to the popular hashed-base Dictionary type, although any other hash based structure will follow a similar behavior, if not the same one. After understanding this post you should be able to spot potential problematic behaviors and resolve them, prevent creation of unreachable items in dictionaries and improve CRUD actions performance on hash based structures. The Theory GetHashCode() is used to create a unique integer identifier for objects/structs. The hashcode can be used for two purposes: Programmatically, by developers, to distinguish objects/structs form each other (NOTE: Not recommended when the default .NET implementation is used, as it's not guaranteed to preserve the same hash between .NET versions and platforms) Internally, by .NET Framework, when using the object/struct as a key in a has...

The GoF Hot Spots - Bridge vs Strategy

As part of my "GoF Design Patterns - The Hot Spots" posts series, this post is focused on two Design Patterns: Bridge and Strategy . Although these two DPs are completely different, when googling them we encounter several common misconceptions that may make us think that Bridge and Strategy are similar or even same patterns. I am not sure why but one of the popular misconceptions is that these two DPs shares the same UML diagram. We will dig into the original GoF Design Patterns (aka: DP) description trying to figure out the real Hot Spots (aka: specific particular parts that differentiating them from each other) of these two DPs and the relationship between them. In order to maximize the clarity of this article, I used two conventions: Phrases inside [square brackets] are meant to help understanding GoF definitions Italic sentences are GoF's book citations Strategy GoF Definition "Define a family of algorithms [Classes that inherits from the ...