I have a very small app which i am using to learn design patterns.
Currently I am trying to implement a dependcy injection container but it just feels like a factory.
Can someone explain what is wrong with the container and where it can be improved.
As i said its very minimal and the app only requires a couple of objects:
class MyContainer
{
public function getObjectA()
{
return new MyObjectA();
}
public function getObjectB()
{
$objectBArrayParam = array('arrparam1','arrparam2', 'arrparam3', 'arrparam4');
$objectB = new MyObjectB('param1','param2', 'param3', 'param4', $objectBArrayParam);
return $objectB;
}
public function getApplicationRunner()
{
$objectA = $this->getObjectA();
$objectB = $this->getObjectB();
$app = new ApplicationRunner($obejctA, $objectB);
return $app;
}
}