Transformational Software Engineering Lead your team into the future with unprecedented visibility. Details
![Blog](https://cdn-ak-scissors.b.st-hatena.com/image/square/b47a94b850347e0f2c3df6222779d9c3e9856707/height=288;version=1;width=512/https%3A%2F%2Fdu10j5vfk4mbr.cloudfront.net%2F_1200x630_crop_center-center_82_none%2Fseo-general-ogimage.png%3Fmtime%3D1684273589)
For almost 6 years, the dominant "best practice" for building rails applications has been skinny controller, fat model. In other words, put all of your business logic in to your models — keeping it out of your controllers. The result is typically a small number of bloated objects that are impossible to reason about or test in isolation [1]. That property is important. To understand why, let's take
Note: This is going to sound crazy at first, but bear with me. The current best-practice for writing rails code dictates that your business logic belongs in your model objects. Before that, it wasn't uncommon to see business logic scattered all over controller actions and even view code. Pushing business logic in to models makes apps easier to understand and test. I used this technique rather succ
I got really excited about DCI recently. I'm still not sure if I get it right, but let me try to describe the way it works and how it can improve our Rails applications. Here is the short version of this blog post: #controller action current_user.extend Buyer current_user.add_to_cart(product_id, quantity) DCI stands for Data Context Interaction. It was invented by Trygve Reenskaug, the same scien
Sep 06 2011 UPDATE: I also have a follow-up here. I often tell people that I learned Ruby via Rails. This is pretty much the worst way to do it, but I’d learned so many programming languages by then that it didn’t hinder me too much. The one thing that it did do, however, was give me a slightly twisted sense of how to properly design the classes needed in a Rails app. Luckily, I obsessively read o
“Skinny Controller, Fat Model” is a well known best practice in Ruby community. Everybody seems to agree with it and follows it. It’s pretty clear what a skinny controller is. The question is what is a fat model and what should we do if it gets too fat? Even better, what should we do to avoid too fat model? I think many people still confuse Domain Model with ActiveRecord. It’s something more and i
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く