Sobes.tech
Junior — Middle

Is it possible to implement the concept of clean architecture outside the business layer?

sobes.tech AI

Answer from AI

The concept of Clean Architecture involves dividing the application into layers with clear dependencies, where the business layer (Use Cases, Entities) does not depend on external layers.

Implementing Clean Architecture outside the business layer is possible, but it would not be a full implementation of the concept, rather an application of the principles of separation of concerns and dependency inversion in other layers.

For example, in PHP:

  • Organize infrastructure layers (e.g., database access, web interface) with clear interfaces.
  • Use Dependency Injection to pass dependencies.
  • Apply SOLID principles in controllers, services, and repositories.

However, without a dedicated business layer, the meaning of Clean Architecture is lost, as the business layer is the core around which the other layers are built.

Thus, ideas of Clean Architecture can be applied outside the business layer to improve code structure, but a full implementation requires the separation and strict delineation of business logic.

Is it possible to implement the concept of clean… - sobes.tech