Dependency injection and UML

Currently I'm testing some php pattern.
To overview I want to use the UML diagram.
Unfortunately I have some problems with the presentation of the chart.
Here is my test setup.


First, I have 4 classes

// ***** Class 'shadow' *****
class shadow {
    protected $fooClass = null;
    protected $barClass = null;

    private function stepOne(){
        $this->fooClass = new foo();
        $this->barClass = new bar();
    }

    public function stepTwo()
    {
        $master = new master();
        $master->setFooClass($this->foo);
        $master->setBarClass($this->barClass);
    }
}

// ***** Class 'foo' *****
class foo {
    protected $bbb = null;

    public function getBbb()
    {
        $this->ccc();

        return $this->bbb;
    }

    public function setBbb($bbb)
    {
        $this->bbb = $bbb;
    }

    private function ccc()
    {
        $this->bbb .= 'ddd';
    }
}

// ***** Class 'bar' *****
class bar {
    protected $bbb = null;

    public function getBbb()
    {
        $this->ccc();

        return $this->bbb;
    }

    public function setBbb($bbb)
    {
        $this->bbb = $bbb;
    }

    private function ccc()
    {
        $this->bbb .= 'ddd';
    }
}

// ***** Class 'master' *****
class master
{
    protected $fooClass = null;
    protected $barClass = null;

    public function setBarClass($barClass)
    {
        $this->barClass = $barClass;
    }

    public function setFooClass($fooClass)
    {
        $this->fooClass = $fooClass;
    }
}

I transport the class foo and bar in the master class.
If I want views the class 'master' as a UML diagram following
see scheme.


uml.jpg
I want all the classes to see.
I want that each class has a color.
I want to see the dependence of classes.

How can I realize this illustration?

Sincerely yours

Stephan

Please sign in to leave a comment.