Component User Framework
Abstract/Idea
The following class diagram shows the idea, how the core of Contrexx should look like in the future:
Here are some thoughts which lead to the diagram above:
- All "real-life-things"/models are based on a single class: EntityBase
- Most "real-life-things"/models have a creator or owner, so they are based on 'Component' class
- Most "real-life-things"/models also have a name and belong to a group and are therefore based on 'User'
- Based on Unix, a user belongs to a (primary) group
- A SystemComponent (formerly known as 'module', 'core_module', 'library', 'template' and 'part of core') belongs to a group, has a creator and a name and is therefore a 'User'
The diagram above is just a visualization of an idea. An implementation of these principles will probably need some more classes around and in between (as you can see for example in the version implemented in 3.1).
Contrexx 3.1
Since we cannot change everything from one day to another, we decided to implement the user part later, so the class diagram for the core of Contrexx 3.1 looks like this (everything in the namespace \Cx\Core\Component was moved to \Cx\Core\Core):
Component Framework v2
This is currently in development.
This introduces a way to let each component decide what version of the framework it wants to use. This allows to make breaking changes to the interface between the base system and the components.
As of component framework version 2 each component has a file Component.yml in its root folder. Components without that file are considered to use the component framework v1.
The following example of a Component.yml shows some of the concepts and ideas:
The included Test.yml could look like this:
Goals
- PHP code should only be written to introduce business logic.
- Simple components can be written without any line of PHP code.
- Allow simpler management of components due to less and more streamlined code.
- Allow simpler management of components due to more modularization.
- All component hooks should only be configs in a YAML file.
- Fix some bugs of v1 (f.e. ViewGenerator configuration namings)
Current state
- Versioning and base features are implemented rudimentarily
- All setup features are not yet implemented
- YAML includes are implemented rudimentarily
- Speed test and optimization pending
The current state can be found here: https://github.com/hbdsklf/LimeCMS/tree/component-framework-v2