DEV Community

Vladimir
Vladimir

Posted on

S.O.L.I.D. is Dead? No. It’s Now Provable with AOK.

For over two decades, Robert C. Martin’s S.O.L.I.D. principles have served as the North Star for every serious developer. We study them, we discuss them in interviews, and we strive to apply them in our code.

But there’s a problem. S.O.L.I.D. is a “gentleman’s agreement.” It’s a philosophy that lives in the minds of architects and on the pages of books, but remains almost invisible in the code itself. How can you prove that your code truly adheres to the Single Responsibility Principle? How can you ensure a new team member won’t violate the Dependency Inversion Principle?

Until now, the answer has always been: “Trust in code reviews and the experience of your team.” That answer is now obsolete.

We’re used to thinking of S.O.L.I.D. as the foundation and our code as the building. But we’ve never seen the blueprints for that foundation attached to the walls of the building itself. Until today.

AOK: Turning Implicit Principles into Explicit Declarations
Architectural-Oriented Knowledge (AOK) is a protocol that extracts the architectural intent from a developer’s mind and embeds it directly into the code as structured metadata. It is AOK that becomes the missing link, making adherence to S.O.L.I.D. a conscious, documented, and verifiable process.

AOK doesn’t replace S.O.L.I.D. It puts S.O.L.I.D. on steroids.

How AOK Makes Each S.O.L.I.D. Principle Measurable:
S — Single Responsibility Principle

The AOK Test: The @PURPOSE tag. If you can’t describe a file’s purpose in one short, clear sentence, the principle is likely violated. @PURPOSE: “Manages user data AND sends email notifications” is an instant red flag.
O — Open/Closed Principle

The AOK Test: The @ARCHITECTURE tag. This is the perfect place to explicitly declare extension points. @ARCHITECTURE: “Extendable via plugins that implementIWidgetInterface, without modifying the core class.” You’re not just following the principle; you’re leaving an instruction manual for those who come after you.
L — Liskov Substitution Principle

The AOK Test: The @ARCHITECTURE tag in a base class describes an unbreakable contract. @ARCHITECTURE: “All subtypes must guarantee that thecalculate()method never returns a negative value.” This protects the system’s logic from incorrect future implementations.
I — Interface Segregation Principle

The AOK Test: The @INTEGRATION tag. If your small class (@PURPOSE: “Formatting a phone number”) is forced to integrate with a massive interface (@INTEGRATION: IGodObjectManager), it becomes an obvious signal to refactor and create a more specific interface.
D — Dependency Inversion Principle

The AOK Test: The @INTEGRATION tag becomes your lie detector. It must contain abstractions (interfaces). If you see @INTEGRATION: MyCoolDatabaseDriver instead of @INTEGRATION: IDatabaseDriver, it’s a direct violation of the principle, visible to the naked eye without reading a single line of implementation code.
The Next Level: @SOLID_COMPLIANCE
To solidify this practice, AOK proposes a dedicated block where the developer performs a self-check and explicitly declares compliance with the principles:
/**

  • @PURPOSE: Processing payments via the Stripe API.
  • @INTEGRATION: ILogger, IUserRepository. *
  • @SOLID_COMPLIANCE:
  • S (SRP): The class is only responsible for the payment process.
  • O (OCP): New payment systems can be added as new classes without modifying this one.
  • D (DIP): Depends on abstractions (ILogger, IUserRepository). / class StripePaymentProcessor { / … */ }

Conclusion: From Faith to Proof
The integration of S.O.L.I.D. and AOK is a tectonic shift. We are moving from a culture of faith that our code is good to a culture of provable quality.

AOK doesn’t just describe architecture. It forces us to analyze and justify our decisions at the moment we make them. It transforms abstract principles into concrete, daily engineering discipline. S.O.L.I.D. is the constitution, and AOK is the oath your code swears to uphold it.

Top comments (0)