Much like the make people happy obstacle, we have the Swiss Army Knife Anti-Pattern.  This mistake is another example of over-architecting a solution.  Think of it as throwing everything into a design instead of thinking through what is needed.  However, this approach is not gold-plating and bells and whistles.  Instead, it adds things “just in case” they are required.

The Swiss Army Knife Anti-Pattern Defined

We often have pointed out patterns that break down and simplify a problem.  The Swiss Army Knife Anti-Pattern is almost the opposite of that.  Instead of breaking a problem into smaller parts, there are fewer, more complex components.  That leads to complicated usage and often confusing results.  Even worse, this anti-pattern creates side effects and magic numbers.  Those last errors come from attempting to do too much in one place.

The Anti-Pattern In Action

Confusion is the word of the day with this anti-pattern.  The users do not see a simple input and output or series of those in the architecture.  Instead, there are large or monolithic components that have dizzying descriptions.  Think of a database with a single table and several conditional fields or values.  There is too much to absorb and keep track of.  Again, the exact opposite of breaking down a problem into digestible chunks.

 

Avoiding The Anti-Pattern

Like many anti-patterns, we avoid this with intention and simplicity.  There is a balance in a good solution between doing work and staying focused.  We avoid tripping over this mistake by sticking to our focus on the problem and solution.  While it is valuable to ask “what if?” questions, that can lead to an attempt to handle too many variations.  Stick to reasonable and likely paths, and your solution will be much easier to understand and manage.

Rob Broadhead

Rob is a founder of, and frequent contributor to, Develpreneur. This includes the Building Better Developers podcast. He is also a longtime student of technology as a developer, designer, and manager of software solutions. Rob is the founder of RB Consulting and has managed to author a book about his family experiences as well as a few about becoming a better developer. In his free time, he stays busy raising five children (although a few have grown into adults). When he has a chance to breathe, he is on the ice playing hockey to relax.

Leave a Reply