Fully implemented an IoC into the core framework (see @Inject annotations).
Fully implemented service providers. ServicesProviders are loaded at startup and are responsible of registering and starting application components
HttpServer and Router are regrouped in the same component
Controllers logic (registering and base controllers/anotations) are regrouped in the same component
App core classes (Debug, Logs, AutoLoader) are regrouped with the Application.
Controllers are now constructed on each request (can implement multithreading?)
Controllers are now declared with @Controllers and autoloaded based on some predefined locations
Controllers can now have a base path to avoid prefixing each routes manually. (For example It's normal that all AuthController routes are prefixed by auth/)
This refactor is quite big because it change most of the application startup lifecycle and management. But now the architecture is more decoupled (each base components work alone) and extensible (we can imagine extensions that can hook into the application by using a service provider).
Also advanced users can now easily override framework components because service provider loading is configured user side.
The functionnality from this app is strictly equivalent to the original (before this PR) app.
What to do next:
[ ] Define explicit public interfaces for each framework components (goes with base functionnality replacement opportunity).
This PR is a follow up on PR #29 .
To summarize:
This refactor is quite big because it change most of the application startup lifecycle and management. But now the architecture is more decoupled (each base components work alone) and extensible (we can imagine extensions that can hook into the application by using a service provider). Also advanced users can now easily override framework components because service provider loading is configured user side.
The functionnality from this app is strictly equivalent to the original (before this PR) app.
What to do next: