5 ms·
"class PostComment" that already sounds wrong if you think about it.
by zinssmeister 14y ago
"class PostComment" that already sounds wrong if you think about it.
- hcarvalhoalves 14y agoHe was correct in that posting to Twitter/Facebook should be refactored, but wrong in the way he actually handled it. I would have approached it by sending a "new comment" signal when a new comment is inserted in the database, and have the specific logic for posting to Twitter and Facebook elsewhere. I don't know if Rails has support for that, and maybe that's the disease because most Rails codebase I've come across seem to just stick to whatever is built-in instead of thinking outside of the box a little for the sake of better design.
- zinssmeister 14y agoyeah I'd write my own class/service to handle facebook/twitter/linkedin/etc.