quantum-php-core icon indicating copy to clipboard operation
quantum-php-core copied to clipboard

Refactor and Optimize `MvcManager` by Moving `Middleware` and `View Cache` Logic

Open armanist opened this issue 1 year ago • 0 comments

The current MvcManager class (soon to be renamed to RouteDispatcher) is responsible for orchestrating the routing process — applying middleware, resolving callbacks, handling controller actions, and optionally serving cached views.

While functional, this tightly-coupled structure violates the Single Responsibility Principle, making the class harder to maintain and extend in the future.

Additionally, the QtController class currently serves as a base for controllers, but there may be little benefit in maintaining it as a distinct class. If refactoring shows that it's not providing enough value, we can consider eliminating it and renaming the RouteController to QtController for consistency and clarity.

armanist avatar Apr 18 '25 16:04 armanist