Over a million developers have joined DZone.

Interfaces as Ball of Mud Protection

DZone's Guide to

Interfaces as Ball of Mud Protection

Jaime Metcher's response to the article "Is Your Code Too Concrete?" in which Edmund Kirwan hypothesizes that using interfaces delays the onset of Mud.

· Integration Zone ·
Free Resource

SnapLogic is the leading self-service enterprise-grade integration platform. Download the 2018 GartnerMagic Quadrant for Enterprise iPaaS or play around on the platform, risk free, for 30 days.

A response to the article "Is Your Code Too Concrete?" in which Edmund Kirwan hypothesizes that using interfaces delays the onset of Mud.

A few observations:

  •  Any well-factored system will have more direct dependencies than methods. Having more methods than direct dependencies indicates that code re-use is very low.

  • For any well-structured system, the relationship between direct dependencies and indirect dependencies will be linear, not exponential. The buttons and string experimental result is not surprising but would only apply to software systems where people really do create interconnections at random. The whole purpose of modular program structure, explicitly, is to prevent this.

  • Abstract interfaces are in no way a necessary condition for modular programming.

  • Finally, the notion that interfaces act as a termination point for dependencies seems a little odd. An interface merely represents a point at which a dependency chain becomes potentially undiscoverable by static analysis. Unquestionably, the dependencies are still there. Otherwise, your call to that method at runtime wouldn’t do anything.

So, I suspect that what Edmund has discovered is a correlation between the use of interfaces and modular program structure. But that is just a correlation. A few years back, there was an unfortunate vogue for creating an interface for each and every class, a practice that turned out to be entirely compatible with a Big Ball of Mud architecture. The button and string experiment provides an interesting support for modular programming, but I don’t know that it says much about interfaces.

With SnapLogic’s integration platform you can save millions of dollars, increase integrator productivity by 5X, and reduce integration time to value by 90%. Sign up for our risk-free 30-day trial!

interfaces ,design ,code ,integration

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}