I have been recently working on Objective C and came across use of Delegate pattern.
I had seen most of the common patterns theoretically in Java, thanks to the Head First book.
But at times looking at differences in Dynamic and scripting languages I get confused about need of certain design patterns.
For example lets take example of Adapter pattern.
It already has two implementations : Object adapter[java] and Class Adapter[C++]. depending on whether the language has supports for Multiple inheritance or not.
But with dynamic languages like Objective-C, duck-typing is possible and also we have methods like respondsToSelector to check if an object actually supports a method or not. So why do we have protocols here even if we need to use a delegate pattern ?
If we can assume anything to be anything.in a dynamic language, do we need concept of abstract class or interface at all to implement few patterns ?
they more look like tools for statically typed languages to give dynamic behavior.
specially I dont understand the need for abstract keyword in PHP.
Can anyone point out some important details, I am relatively new to this.