PHPackages                             dakwamine/component-based-object - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dakwamine/component-based-object

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dakwamine/component-based-object
================================

Helps building apps using component based objects.

3.0.1(2y ago)12771MITPHPPHP ^7.3 || ^8

Since May 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Dakwamine/component-based-object)[ Packagist](https://packagist.org/packages/dakwamine/component-based-object)[ RSS](/packages/dakwamine-component-based-object/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (13)Used By (1)

Component based object
======================

[](#component-based-object)

A simple starter class for component based objects.

This is used when flexibility is needed, for highly interactive components.

Dependency solver system
------------------------

[](#dependency-solver-system)

From version 3, you have a new dependency solver system. It makes instantiation easier.

You may declare dependencies by extending `getDependencyDefinitions()`.

Using the class constructor and the `new` keyword is highly discouraged to prevent logical problems on instantiation. Always use the methods to add or retrieve components.

You can set two types of dependencies:

- root: easily acccessed using static methods by any object.
- fellow: accessed by components on the same "level" (siblings). Rarely useful. Used for interdependent components or components without special relationships (root components are all fellows).

You can create sub-components, but they cannot be added during the dependency solving step. They must be added after the instance is ready.

```
