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

How to Transform Your Business in the Digital Age: Learn how organizations are re-architecting their integration strategy with data-driven app integration for true digital transformation.

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.

Build and deploy API integrations 7x faster. Try the Cloud Elements 100% RESTful platform for 30 days free. Access your trial here.

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 }}