The Artima Developer Community
Sponsored Link

Java Buzz Forum
Rails: requires, class loading, and magic

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
Rails: requires, class loading, and magic Posted: Nov 6, 2006 11:30 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: Rails: requires, class loading, and magic
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement

James Duncan Davidson has written up a frustrating experience where he learned Rails Sometimes Eats Class Load Errors.

After the trouble debugging the issue, James suggests:

Use require what you need where you need it. I tend to do this in my code all the time, probably from the habit of using include and import in other languages which are a bit pickier about such things. But, from now on, I'll be prompting others to do this as well in Ruby, especially when using Rails. Don't trust environment.rb. There's too much magic there.

It is interesting to hear this, when on the other hand you learn about the new dependency management in Edge Rails.

Edge Rails lets you put code in yourappproject/mystuff/foo.rb in the package Mystuff::Foo and it is all loaded for you. This means that you can do LESS require-ing.

However, there does seem to be a bit too magic going on here, and I often forget the order of when things are loaded, which can be very painful indeed.

I wonder if someone has written up the dependency cycle of Rails so we can print it and put it on the wall :)

Read: Rails: requires, class loading, and magic

Topic: Java 1.6: Finally Integrating With The Underlying Platform? Previous Topic   Next Topic Topic: Which open source CI tool is best suited for your application's environment?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use