Here are some excepts from Rails Antipattern book that I have reading lately. Even though the examples are specific to rails, the fundamental principles applies to pretty much any MVC framework. In this post, I list out various Model Antipatterns & their potential solutions. I would be writing about other anti-patterns in next posts …
Antipattern # 1 : Voyeuristic Models
Solution: Follow the Law of Demeter
Solution: Push All find() Calls into Finders on the Model
Solution: Keep Finders on Their Own Model
AntiPattern # 2 : Fat Models
Solution: Delegate Responsibility to New Classes
Solution: Make Use of Modules
Solution: Reduce the Size of Large Transaction Blocks
AntiPattern # 3 : Spaghetti SQL
Solution: Use Your Active Record Associations and Finders Effectively
Solution: Learn and Love the Scope Method
Solution: Use a Full-Text Search Engine
Curiosity killed the cat & complexity killed the project !!
The importance of simplicity in application development is paramount. Complexity is the number-one killer of projects today, and it comes into an application in many ways, including through excitement over new features, overly clever developers, and unfamiliarity with the Ruby on Rails framework.
In this post, I would like to explain an extremely useful use-case of one of my favorite and highly popular tool Delicious. Let’s say I came across a useful URL that is relevant to the work that I am doing or stuff that I am interested in. For instance in this case, I came across rFacebook , a ruby gem for interacting with Facebook API.
Now, I want to search for more related links to Ruby, Rails and/or Facebook. Here is what I did:
1) Bookmarked this link on Delicious. As you can see in the image, the Addthis Addon already shows that it has been saved 391 times.
2) Select a few tags for instance rails & facebook in my case & click save. Once you have saved the link as well, it would go to delicious & increment the count by 1. Now it it showing 392 for me.
3) Click on the count to open all the saved items for this URL.
3) Now it shows all the users that have saved this URL & the tags they have used for this URL.
4) You can click on the tags to view other URLs that they have saved for these tags. Lastly, you can also add any of the users that you find useful to your network so that you can quickly browse their bookmarks quickly at any time.
I have found this to be a very useful technique to discover new, useful & relevant content. Hope you find it useful as well.
India’s first RubyConf is happening in Bangalore in March 2010, 20th – 21st.
The conference was SOLD OUT. They have added 150 more seats.
Facebook developers get some more good news. If you are worried about having a reliable hosting space for your Facebook application, you can get it Free. Joyent is giving free PHP5 hosting along with MySQL, Rails 1.8.6 ,Python free for 1 year, if you are a Facebook application developer.
Other companies offering free hosting for Facebook developers include Jumpline.com & Freeunmeteredhost.com.
A ComputerWorld article has named RoR as one of the top 5 technologies you need to look in 2007. Only one in the software, rest are Hardware related.
It seems like every month a new technology emerges with the potential to change everything. Technology writers and analysts get hyperexcited. Everyone starts patting one another on the back and hugging. And two years later, we’re still talking about the promise of that technology, with little to show in the here and now.
That’s why as we began to look at core technologies that may have the greatest effect on the world of computing over the next 12 months, we paid special attention to how soon these advances will be available to everyday users, either at the enterprise or the personal level. The result is the following list of five emerging technologies with groundbreaking potential — this year as well as in the future.more
RailsConf 2007 has been sold out within a couple weeks of opening, even though they had doubled the seats this year to 1200. This is the first time when Orielly Media is organizing the official Rails conference. They still have a waiting list for the conference if you want to sign up.
See you there.
Registration for Ruby on Rails Conference 2007 is open now. This year it would be held in Portland, Oregon from May 17th – May 20th. If you want to attend the conference, hurry up as the conference last year was sold out in a week. I have heard that within the first day of opening, almost half the seats are gone. That is about 600 registrations in the first day.
If you are a member of any Orielly group, Just enter the discount code rc07usrg and get another 15% off the conference fees.
It was just last December that Tim O’Reilly said that Ruby book sales had surpassed Python book sales. Now Ruby book sales have also surpassed Perl book sales.Tim O’Reilly posted the graph below which shows the books sales since 2003 for the most commonly used dynamic programming languages.