Understanding afferent and efferent coupling

Before splitting code into separate components, the first step is to analyze the existing code structure. Are there any high-level domain concepts that stand on their own? For example, a banking application may involve account management, deposit/withdrawal, balance transfer, customer notification, and so on. Each of these domain concepts can potentially be split into separate components.

We must also understand how components interact with each other. Here, we will talk about two concepts that originated from object-oriented programming:

  • Afferent coupling – number of external entities that depend on the current entity
  • Efferent coupling – number of external entities that the current entity depends ...

Get Hands-On Design Patterns and Best Practices with Julia now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.