Thursday, November 24, 2011

Re: Observer Pattern in CakePHP 2.0

I thing the example in article 2 is great but i don't think is necessary to create a component to register observers.

Observer pattern need two part, Subject and Observer, so i think you need another observer behavior ( not only observable behavior ).

Observer pattern is usually implemented by interface, cakephp's behavior can do the same.


On Wed, Nov 23, 2011 at 12:34 PM, amiable_indian <mithu.singh@gmail.com> wrote:
Hi All:

I would like to implement observer pattern [1] in my project and would like to hear your suggestions regarding cake's way of doing it the right way. Most web searches led me to an article [2] written in 2009. I am sure a lot of things have changed since then :)

In my project (which tracks movement of domain names and ipaddresses), I am looking to implement observer pattern where whenever the subject (e.g. domain name) changes (e.g. moves to a new ipaddress), it triggers multiple observers such as reputation, blacklisted, whitelisted, ranking, geo-location, etc...

Thanks in Advance,

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php



--
Perry | 彭琪

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: