The observer pattern is really quite handy:
“Hey, you, the dude responsible for managing Josh’s twitter posts! Let me know when he posts something new! My address is…”
REST, JSON, SSL, toss out any number of acronyms you want. It’s doable in a number of different ways. So why isn’t it common? Why can’t I subscribe to your blog and have it notify me when you make a new post? Forcing me to poll your RSS feed periodically to see if you’ve made a new post is, shall we say, fucking backwards and wrong!!
So what are the real challenges here?
- Callback address. What if a registered observer changes their callback URL? How do we address them?
- How do we authorize changes? Must research OpenID/OAuth and see if there are systems that might work for this.
- Sufficiently extensible and user-definable. No locking the user profile into ONLY having fields like “favorite pet” and “smoker y/n”. No limiting the language used.
What might this look like?? If I (joshproehl.com) want to obsevre events at daedalusdreams.com I could send this:
And then when daedalusdreams.com makes a change to the blogposts it would know to send this:
I’m having trouble visualizing both exactly how this would work, and why it might not. I think it may be time to start diagramming some things out.
Continue reading in Part 2