- Write a dispatcher from xmpp4r to ActionController. Get rid of that ugly while true loop.
- Write a proper render action. Have ActionController look for some sort of proper template, like status.chat_response.erb. msg.from could be easily DRYed out, since you'll be responding to the same person every time.
- Release it as a rails plugin
- Profit.
Thursday, June 26, 2008
Area Man Misses the Point of MVC
Just this morning, I read about a guy who integrated some instant messaging features into an application.
First of all, good on ya for using Rails. You're lightyears ahead of those idiots still using PHP.
On the other hand, the ENTIRE point of MVC is a consistent stack of logic to render information back to clients. In Rails, this is achieved with ActionController scrounging up instances of Models for use by ActionView.
So, instead of doing a 1980's style of dispatching, why not try this?
Subscribe to:
Post Comments (Atom)
1 comment:
Thanks for your feedback. I've posted a more detailed reply on the original article about making your own IM bot, but I'd like to discuss with you further (maybe privately to keep the noise down) your approach in a bit more detail.
Post a Comment