Why no observer patterns?

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…”

That’s basically it. It works in Cocoa, it works in SproutCore (Javascript), it works in Rails.. Why has it never been taken to a wider scale?? I understand that pushing to users is difficult due to the “statelessness” of HTTP, but “push”ing between servers with static IP/Hostnames should be decently trivial.

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?

  1. Callback address. What if a registered observer changes their callback URL? How do we address them?
  2. How do we authorize changes? Must research OpenID/OAuth and see if there are systems that might work for this.
  3. 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:


http://daedalusdreams.com/observer/create
POST
{
model:blogpost
callback:http://joshproehl.com/listener/
}

And then when daedalusdreams.com makes a change to the blogposts it would know to send this:


http://joshproehl.com/listener/
POST
{
source:http://daedalusdreams.com/
model:blogpost;
sourceURL:http://daedadalusdreams.com/blog/5
}

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

My kind of “fantasy”…

I make no secret of the fact that I consider fantasy to generally be “fluffy”. Fluffy can be fun, but generally I like a story that has something to tell you, or something interesting to say. That said, I listen to both Escape Pod (for all my deep-thought sci-fi needs) and Podcastle (sometimes you just want to heard about dragons).?

The latest episode of Podcastle certainly fulfilled both “fun” and “thoughtful” though! Episode 49, “Return of the Warrior” is quite enjoyable, and I highly recommend that you go and listen to it! It’s only 25 minutes, which isn’t a huge time investment, so no excuses!?
This story is written very much in the “short story” form, designed to get it’s point across in the minimum of words. It manages to add enough humor to make you grin, but include enough depth to make you go “ah hah!”. And that’s all I really want to say about it. Just go listen. 🙂

Predictability in UI design

So today I had the dubious pleasure of working all afternoon on UI design in Cocoa, and then UI design in Rails/CSS/HTML.?
Going from one to the other really highlights some of the problems in doing web-based design!

My big issue with writing in HTML/CSS is? predictability. I do not? enjoy wondering if something is going to render properly, or if a particular CSS attribute is going to work the way it ought to.

Maybe I’m doing it wrong. Maybe CSS doesn’t suck as bad as I seem to think. But until I can say “you, the content box! Size yourself to fit around the content inside you and then position yourself in the center of the screen” just that easily…