Rails Misapprehensions: The Dependency Injection Pattern

{{{ Inspired by the “Stop hating Java”:http://andrzejonsoftware.blogspot.com/2011/07/stop-hating-java.html post by my friend Andrzej I started to identify the pros and cons of a pattern called _Dependency Injection_ in the Ruby/Rails world. Before I explain the pattern, let me discuss the problem – a dependency. h3. What is a Dependency? Let’s say we’re working in a casual… Continue reading Rails Misapprehensions: The Dependency Injection Pattern

Cells 3.6.0 released – Rails 3.1 here we go!

{{{ Just released “Cells 3.6”:https://github.com/apotonick/cells – Cells are view components (aka portlets or widgets) for Rails. The new version runs with Rails 3.0 _and_ 3.1 and it has no cool new features! The “view inheritance code”:https://github.com/apotonick/cells/blob/v3.5.6/lib/cell/rails.rb#L146 got obsolete for 3.1 since Rails itself implements it, so “Andrzej Krzywda”:http://andrzejonsoftware.blogspot.com/ and I decided to introduce a “Strategy… Continue reading Cells 3.6.0 released – Rails 3.1 here we go!

Rails Misapprehensions: Caching Views is Not the View’s Job!

{{{ Caching is a generic approach to speed up processing time in software. A common pattern used in Rails is to *cache already rendered markup to save rendering time*. Basically, there are two concepts for view caching in Rails. * *Page caching* saves the complete page. This is good if your page doesn’t have dynamic… Continue reading Rails Misapprehensions: Caching Views is Not the View’s Job!

Cells 3.5 Release Party Summary

{{{ Yesterday we released “Cells 3.5.0”:http://github.com/apotonick/cells, which is another step towards real component-orientation in Rails. *The release party was a big hit.* }}} {{{ “Cells”:http://cells.rubyforge.org/ is the one and only *view components framework for Rails*. It has a vivid growing community and had almost 10,000 downloads in the last year. That’s cool. h3. What’s new?… Continue reading Cells 3.5 Release Party Summary

Pragmatic Rails: Thoughts on Views, Inheritance, View Inheritance and Rails 3.0.4

{{{ While hacking on “Cells”:http://cells.rubyforge.org/ for Rails 3 with Yehuda earlier this year we were discussing if Cells’ view inheritance will be superseded by Rails.Yehuda patiently *postponed any work on it* with the words _”we will do that for you”_ 🙂 Apparently, he didn’t lie. It seems that “view inheritance will be available directly in… Continue reading Pragmatic Rails: Thoughts on Views, Inheritance, View Inheritance and Rails 3.0.4

Pragmatic Rails: Let’s do AJAX-backed Sidebar Widgets right, Jim!

{{{ Days ago “I explained how to write a sidebar widget in Rails”:http://nicksda.apotomo.de/2010/11/lets-write-a-reusable-sidebar-component-in-rails-3/, using the view component framework “Cells”:http://github.com/apotonick/cells. This was fun. Clicking a tag leads to a page reload, where the _Recent posts_ list *displays items matching the tag*, only. It worked great, however, each click needs a real HTTP request and a reload… Continue reading Pragmatic Rails: Let’s do AJAX-backed Sidebar Widgets right, Jim!

Rails Misapprehensions: What the fuck is MVP?

{{{ People usually make me feel slightly embarassed when they ask things like *”How does Cells handle MVP?”* or, even better, *”Is there any MVP _implementation_ in Cells?”*. Frankly, *I don’t have a fucking clue about the _real_ differences between MVP and MVC*. In the past I usually deflected people’s attention by buying beers instead… Continue reading Rails Misapprehensions: What the fuck is MVP?