Commit Graph

3 Commits

Author SHA1 Message Date
ae94dca984 Removed deprecated methods from Factory.
All classes that use this have been changed.
2016-06-02 20:12:22 +02:00
544a84434c Allowed the Factory class to be extended.
A class can now extend the Factory class and use all of its properties.
Properties like the layout system can be called like $this->layout, when extended. Just like the old days with the Bus abstract class.
Advantage of this system is that you don't require the use of extending the Factory class. Calling the factory for just one use is also possible.

Closes #93.
2016-06-02 13:57:32 +02:00
bc6136525b Implemented the Factory and the FactoryTest.
The Factory class is the central point for class communication in FuzeWorks. When someone needs to load, for instance, the layout class, one has to do the following:

$factory = Factory::getInstance();
$layout = $factory->layout;

The Factory class allows the user to replace dependencies on the fly. It is possible for a class to replace a dependency, like Logger, on the fly by calling the $factory->newInstance('Logger'); or the $factory->setInstance('Logger', $object); This allows for creative ways to do dependency injection, or keep classes
separated.

It is also possible to load a cloned instance of the Factory class, so that all properties are independant as well,
all to suit your very needs.
2016-05-27 16:33:12 +02:00