Design Pattern

Posted on

Hello out there,

the last few days we kept our-self busy with Design Patterns and how we should apply them to our code. Basically what we did was rewriting our test code, so we would use a Factory taking care of creating instances of our classes.

What we changed now is replacing the code with factories, so we would not have to care about the instantiation of the models.

The actual factories are defined in a separate PHP  file but since this doesn’t belong to a class it can’t be displayed in the class diagram.

Basically the code now looks much cleaner and improves the maintainability (you don’t have to change the code at five different locations => DRY).

2 thoughts on “Design Pattern

  1. Hello from MuM,

    as Niko said earlier, your class diagram shows everything before and after implementing the “factory”-pattern. Good job!
    We are also missing some code examples, would be nice to see them 🙂

    Kind regards, MuM.

  2. Hey mMio,

    your design patterns are clearly shown in a before and after class diagram view.
    I couldn’t find your code example, may you can show it to us.

    Good work, keep it up!
    Niko from WhiteCode

Leave a Reply

Your email address will not be published. Required fields are marked *