The Swiss Army Knife AntiPattern episode artwork

EPISODE · Jun 21, 2019 · 20 MIN

The Swiss Army Knife AntiPattern

from Develpreneur: Become a Better Developer and Entrepreneur · host Rob Broadhead

A swiss army knife is a great tool to carry around with you.  However, this anti-pattern tells us that building a one-stop-shop for your design functionality is a wrong approach.  Several problems arise when you throw almost everything into a single class. Defining the Swiss Army Knife Anti-Pattern I found a good blog post on this anti-pattern to provide our definition.  The article focuses on an interface, but it holds for a class in general as well. [Click Here to See The Page] "Swiss Army Knife Interface is an interface class which has excessive number of method definitions. Architect/designer may design this interface to use for every need of the software, but this is a wrong approach and an antipattern. More than one interface must be designed using some design approaches." We stumble onto the idea of what is a proper number of methods for an interface or class.  Unfortunately, this is not a hard and fast rule.  It is something that varies by situation.  Thus, "too much" is left up to the designer and not a single number or even range, although 7-10 seems like a comfortable range for most people. Design First, Then Code It may feel like we have gone down this path before.  And we have.  Many anti-patterns, including the swiss army knife, can be avoided with design and planning before you dive into implementation.  However, in this case, there needs to be an on-going habit of designing before coding.  When you skip that step, you can find yourself building a solution that grows ever closer to this anti-pattern. Easy To Miss The toughest challenge with this situation is stepping back and seeing it approaching.  It is far easier to tack on function after function without keeping the big picture in mind.  When you stay in the weeds too much, it is easy to overlook the swiss army knife you have created.

Episode metadata supplied by the publisher feed · Published Jun 21, 2019

Embed this episode

NOW PLAYING

The Swiss Army Knife AntiPattern

0:00 20:38

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

No similar podcasts found.

Frequently Asked Questions

How long is this episode of Develpreneur: Become a Better Developer and Entrepreneur?

This episode is 20 minutes long.

When was this Develpreneur: Become a Better Developer and Entrepreneur episode published?

This episode was published on June 21, 2019.

Can I download this Develpreneur: Become a Better Developer and Entrepreneur episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!