views:

43

answers:

1

i know that in Java you can use their built-in APIs for design pattern.

eg. if you want to use the observer pattern, you just have to extend your Subject class with the Observable class.

is this possible for PHP? are there any libraries for the design patterns ready to use. in this way you don't have to reinvent the wheel and you also let many developers follow a standard.

does Zend library have these API:s?

+2  A: 

Design patterns are usually not as "ready to use" provided by API's. It's you, the developer, who should write the code according the rules of a design pattern . This Wikipedia page is a good starting point to learn about general design patterns and how to implement them. Each pattern is explained in detail with rules, schemes and code examples. Click your way through the patterns in Wikipedia table.

You also usually don't choose a design pattern before solving a problem. You first have to determine the problem yourself and then check what design pattern can be used to solve it the right and OO way.

That said, the Observer/Observable API is actually rarely used in real world Java applications. Even more, they are obsolete.

BalusC