I am trying to get accustomed to the ways of PHP 5.3 and I am confused. :o
Are they both accomplishing the same thing?
No, they are very different. Dependency injection means "give me all of the objects I need to do my task." A good counter-example would be a class that uses other singleton classes or has other hard-coded dependencies.
Mixins are essentially objects or classes that you can more or less merge with an existing object or class to provide its behavior to the consumer of that object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With