I have used the observer pattern to create http://mootools.net/forge/p/historymanager . it's basically a domain observer that lets you monitor and change various object's state. It's a great way for creating non-obtrusive communication between objects
On Mon, Jan 3, 2011 at 8:51 PM, Mark McDonnell <[email protected]> wrote: > I've been reading through Stoyan Stefanov's latest book "JavaScript > Patterns" and was interested to know who here has used the Observer design > pattern and could you provide some examples of how you had used it. > > Here is a link to the example provided in the book: > https://gist.github.com/763762 > > At the moment it seems like I have 'a solution looking for a problem'. I > can see that this pattern could be quite useful with a more advanced > JavaScript application (being the event driven nature of JavaScript) but I'm > not sure what scenario I would use or could use such a pattern? > > Any ideas or suggestions you may have would be greatly appreciated. > > I know this is a bit of an odd request, but really I'm just interested to > know what 'real world' examples there are using this pattern so I can get a > better idea (when the time comes) how I can use it. > > Thanks! > -- > Mark McDonnell > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/[email protected]/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/[email protected]/ > > To unsubscribe from this group, send email to > [email protected]<jsmentors%[email protected]> > -- Arieh Glazer אריה גלזר 052-5348-561 http://www.arieh.co.il http://www.link-wd.co.il -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
