Tag Archive 'oo'

The Composite pattern is a very powerful design pattern that you use regularly to manipulate a group of things through the very same interface than a single thing. By doing so you don’t have to discriminate between the singular and plural cases, which often simplifies your design. Yet there are cases where you are tempted [...]

Now that enterprises have chosen stable platforms (JVM and .Net), on top of which we can choose a syntax out of many available, which language will you pick up as your next favourite? New languages to have a look at (my own selection) Based on what I read everyday in various blogs, I arbitrarily reduced [...]

This anti-pattern is about Using String instances all the time instead of more powerful objects. This is a special case of primitive obsession. Examples Here are some flavours of this anti-pattern: String as keys in a Map: I have seen calls to toString() on objects just to use their String representation as a key in [...]

Many concepts look obvious because they are used often, not because they are really simple. Small quantities that we encounter all the time in most projects, such as date, time, price, quantity of items, a min and a max… hardly are a subject of interest from developers « as it is obvious that we can represent [...]

Low coupling between objects is a key principle to help you win the battle against software entropy. Making sure your dependencies are under control matters. Several tools can enforce dependencies restrictions, such as JDepend. However in a real project with many classes, packages and modules, the real issue is how to decide and configure the [...]

In finance, options are powerful tools for traders, and many design practices including design patterns can be seen as options. Options can -perhaps- yield a great benefit for a certain and immediate cost. If this cost is cheap enough it can be quite attractive. An option to buy a stock is a right to buy [...]

Composite patterns, such a the Bureaucracy pattern, are patterns built by the composition of other « smaller » patterns. However even usual design patterns can be considered composite patterns made of smaller subpatterns. The goal is therefore to find out which are the main subpatterns that enable to reconstruct as many design patterns as possible. The subpatterns [...]

I have experimented an approach that considers every design pattern as the recursive composition of smaller patterns. This led to a prototype tool to illustrate its benefits by generating design-level documentation of annotated source code. Eat your own dog food The source code of this tool itself was used as the code base to apply [...]

Information hiding is one of the very essential principles of object orientation. If you dont know it well, I suggest you take a look at it on the Web, e-g at UncleBob. But information hiding is much more than just putting data private through accessors to protect them, it is especially a great tool to [...]