New talk
flat | nested
at the canada on rails conference (1 points)
in rails, canadaonrails by jtoy on Thu Apr 13 00:17:45 -0500 2006

John and I will be at the Canada on Rails conference. We will be posting information about the conference at this thread. If you have any questions, please ask here.
Thanks!!!

DHH's keynote speech at CoR (2 points)
in rails, canadaonrails by jtoy on Thu Apr 13 12:48:33 -0500 2006

Im at the conference now. DHH just gave his speech, here are the notes:
History of rails:
Rails has been around for a little more than 2 years. There have been over 500,000 downloads through ruby gems, while the rails book sold over 40,000 copies (a lot)!!!! A computer book is considered a good hit if it gets over 5,000 copies sold.
There is also a campfire url for the conference at http://37s.campfirenow.com/eb527
Rails has been mentioned on many large sites such as apple, IBM, slashdot, Oracle, and many others. There have been patches accepted from over 400 people to the rails source code. On Wikipedia, “David is widely considered to be extremely arrogant.” David says a lot of people have been trying to put down rails saying things such as “it can’t scale”, “rails is too slow”, “its too opinionated”, etc.
His response “F*ck You”. He likes to be opinonated and do things his way, so he does not care what others think.
Where rails is not going:
OpenACS and ZOPE
Component frameworks need too much work to build than doing it from scratch.
There needs to be a better level of extraction. Too generalized components are not good. A good level of extraction is acts_as_list.
Rails is used for us (the developers), so that we are happy with our work.
That means small teams doing big things.
So finally, where are we actually going?
The next versions are:
1.1.x which will have bug fixes and be fairly frequent.
1.2.0 which will be the next mega release maybe in 2 or 3 months.
2.0.0 may be out by the end of the year, still have not thought about what features they want, but 2.0 will get rid of all the baggage. Parts of the API will be changed.
Rails will always be about the infrastructure and not business logic.
Some major parts of rails that will be changed:
components,javascript macros, pagination, rich habtms, action web services.
DHH regrets adding components, he does not use any components. DHH is planning to take out components and put it into a plugin. There are many bug tickets regarding the js macros and there are too many ways to do write js.
Pagination will also be turned into a plugin. Rich habtms will be changed for some reasons that I forgot to write down why. None of the rails core team doesn’t use Action Web Services, so that will be moved to plugins. DHH likes plugins and will promote them more. At 37Signals, they use 5 to 6 plugins per application.
DHH is working on caching.
HTTP #1 caching: In the latest rails release, css,js, and images are cached for 3 days via:
e-tag,if-modified-since,304+output compression+/images/logo.png?200604121745.
HTTP #2: REST: REST uses verbs: GET,POST,PUT,DELETE . DHH says the Google web accelerator team are a bunch of morons for destroying half of the web.
GET maps to read something. POST maps to changing or doing something destructive.REST maps pretty well to CRUD.
PUT is updating something. DELETE is for destroying. The goal is to have a single controller be used for both html browser views and REST applications. DHH went over a bunch of code examples, too much to write down.
The main goal is 1 controller, 2 resources, unlimited clients. respond_to in rails 1.1 is part of the groundwork that will bring rails to do this. You can get the plugin for this now from Jamis Buck’s website.
“Just one more thing”. DHH calls it armageddon. He has some RJS code to control the browser from the commandline. It is done via flash by keeping a socket open on the browser side, then when the webserver gets new updates, it will send the data to the browser. This eliminates the need for the browser to poll the server every X seconds. The code for this is not done yet, but when completed, it will be wrapped up into a plugin. You could do this for something like instant messaging.
QA:
the difference between components and plugins. Components have their own controllers and views. Plugins add functionality. Plugins are usually very small in LOC. The page listing for plugins is not good, there are good ones and bad ones. Look at the plugins in the rails svn repo to see what plugins follow good coding standards.

SOA from Joe O'Brien (1 points)
in canadaonrails, soa by johnli on Thu Apr 13 13:53:39 -0500 2006

Enterprise SOA with Rails
from Joe O’Brien
a re-introduction to Service Oriented Architecture
Some of material from these slides are coming from a new book from the Pragmatic Programmers.
Joe’s blog is at blog.objo.com
Don’t read SOA material from companies because it is not a product, it is a software pattern.
We don’t want to rebuild everything.
SOA != NEW, but many people think these ideas are new.
SOA == Agile. People think SOA is not Agile.
Some good info on SOA at http://carlaugustsimon.blogspot.com from Carl Simon
What is a service?
A service is a well-defined function that is universally available and responds to requests from “service consumers”
Your interfaces need to be very well defined. It must be context free. It needs to be cross platform, don’t use specific technologies such as CORBA.
Vertical Slice:
a core service that requires every layer of your application to work.
asynch communication is important. How can we apply it to are business domain and logic.
In your code/API, don’t expose your privates.
XML is not the “Root of all Evil”. XML is not good for configuration files, but it is very powerful for cross-platform communications.
.to_xml is a great new addition to Rails. If things are done in a smart way, then we can combine existing applications with our new rails apps. Check out ActiveMessaging, its a new library for ruby that allows us to communicate with Java. Check out http://www.activemq.org/Stomp
QA:
Can you talk about DSLs?
Domain specific languages are very prevalent in Ruby. Joe is writing a book on writing DSLs in Ruby and other languages.
What weaknesses does rails have doing larger “enterprise projects”?
Agile methods are very powerful. Joe suggests asking other people this question such as Obie Fernandez.

RE: SOA from Joe O'Brien (0 points)
by cgramona on Fri May 12 12:50:29 -0500 2006

Our company (as are most) will be migrating to an SOA archiecture over the next serveral months. After being in the Java and MS/.net world for several years I find RoR to be much easier to learn and use and is more productive and agile to boot.
But…. one big issue is the WS_* support that is needed in an SOA architecure. It does no good to create Web Sevices to enable SOA if they cannot be secured and managed.
I would like to adopt Ruby for our SOA intitiative – escpecially since I need to bring a few developers up to speed and I loath to do that in Java or .net – but I wonder if RoR based SOA has solutions avialable for security and management or will play niecly with other products that provide this.
Ideally an appliance using Service intercepters could be installed that wouldn’t care about the environment of the Web Service (Apache on Windows)or the language(RoR).
Any advice on this would be appreciated and any clue as to when a rough cut on your up comming book will be avialable?
Thanks,
Carl

RadRails presentation from Kyle Shark (1 points)
by johnli on Thu Apr 13 15:40:44 -0500 2006

Tooling Rails
from Kyle Shank from the RadRails team
What is RadRails?
Eclipse based rails IDE that is open-source and free.
First released on 9/27/2005 from 3 RIT software engineers, who where all on co-ops at IBM.
About 30,000 downloads.
Motivation was to create a gateway drug for Java developers and was cross platform, open, and free.
Bad frameworks can elicit bad tooling. One of the problems with J2EE is that it requires tooling, while Rails is wonderful because it doesn’t need any tooling. Tools are a convenience for Rails, but is not required.
In designing RadRails, control was a very important design goal.
Many RAD tools take away control.
Software is actually supposed to make our lives easier and so RadRails promtoes this thinking by incorporating:
Server tooling, data tooling, testing support, RHTML editor, fast controller/view and test switching, generators view, svn support, and more.
Then Kyle went through a demo of using RadRails. Some of the challengs of RadRails are cross-platform configuration and providing intelligent assistance with a dynamic language. The code name for RadRails 1.0 is Dorothy. There will be many new features such as capistrano support, plguin support, visual breakpoint debugging, and other features.
Several CEOs have talked to Kyle about partnering with RadRails. There maybe commercial plugins for RadRails later.
QA:
Is the code all written in Java?
All the code is compiled in Java. Eclipse helped since the infrastructure was already in place.

Dave Astels's Behaviour driven development talk (1 points)
in canadaonrails, bdd by johnli on Thu Apr 13 16:57:23 -0500 2006

Behaviour-driven development in Ruby.
from Dave Astels.
Dave has written a few books.
So what is BDD?
Technically, TDD and BDD are the same, but they are different philosophically.
Most people that do TDD are not doing it very well, so that is why we have BDD.
First part of the problem is testing. In BDD, we aren’t testing, we are designing. Unit testing is a vague term, so instead of talking about testing and units, we will talk about behaviour.
Things like assert_equal(expected,actual) are not intuative. A better way could be something like actual.should.equal expected
It’s even nicer in smalltalk: actual should equal :expected
Rspec currently has:
should.equal 5
should.not.equal 5
Works for floats, objects, counts,arbitrary blocks, pattern matching,throws, and many other features.
should.have(5).items
shoud.have.at.least(5).items
should.satisfy {|obj| ...}
should.match /.../
should.be.an.instance.of C
should.be.a.kind.of C
should.respond.to :message
Rspec has a DSL for writing the BDD code. There is a mock API similar to Jmock.
Currently there are no rails projects that are using rspec, but development is ongoing now to integrate the 2.
In terms of actually coding, the process is similar to TDD in which you write one spec at a time as you are writing code. You will also need to do refactoring.
You can install this via gem install rspec. The site is http://rspec.rubyforge.com
Dave’s blog is at http://www.daveastels.com

Steven Baker talking test driven development (1 points)
in rails, canadaonrails, tdd by jtoy on Thu Apr 13 18:21:27 -0500 2006

Steven Baker talking about Test-driving the rails
Specification not verifcation.
When having a full test suite, we can do things such as refactoring and not be worried that our code will break. You can also decouple your code easier because of testing. A good book to read is on the rails wiki that goes over testing with rails. http://manuals.rubyonrails.com/read/book/5
Once the rSpec plugin is done, you’ll be able to replace unit tests. rSpec should work with rails in a few weeks.
Steven then went over some examples of code, which you can also find in the rails wiki book.
When you are writing tests and your tests fail, you will always know your next step because your tests are directing you. Errors are thrown exceptions and failures are assertions that failed in your tests.
Functional testing is more complicated than unit testing.
Mocks are user to provide empty classes, they act as stubs so you don’t actually need to do things like access the network or database.
Steven uses a “welfare mac mini” (g4).
Some of his tests on a larger project run for 16 seconds to go through the whole suite (355 tests, 521 assertions).
Tests help to keep a developer sane.
QA:
Are there projects too small to use tests?
NO
Steven is currently learning io. http://iolanguage.com
Steven does all rails projects and using rcov for coverage.
How can you do testing when you never had a spec?
Steven answered: does your code do anything? if so, then you can write tests for your code.
Steven does TDD full time.
Do you tell clients your clients that you test, becuase some clients don’t want to pay for it?
Steven usually works with the same clients, but some clients have had mixed reactions. If clients don’t want unit testing, then you need to show the client that the code quality will improve.
Can you talk about selenium?
It uses javascript to simulate a user. It provides another level of testing.

David Black's speech: "Meditations on Ruby/Rails Ratio" (1 points)
in rails, canadaonrails by jtoy on Thu Apr 13 19:40:17 -0500 2006

David Black presenting:
“Breaking Through the Programming Glass Ceiling”
David black has Ph.D. and works at Ruby Power and Light, LLC
He decided he is changing his topic though to:
“Meditations on Ruby/Rails Ratio”
David is also writing “Ruby for Rails” to help address: “is it important to learn Ruby if you’re using Rails?”
The perception of Ruby in regards to Rails have several forms:
“Ruby is too advanced”, its a higher level language.
or
its too low level.
David does not believe in either of those views.
Instrumentality:
In theory, it shouldn’t matter what programming language you use because they are all tools and can accomplish the same things, and similiar to music, all instruments produce music, but musicians really do care about what instrument they use, as programmers care about what programming language they use.
Rails promotes a certain culture. David is interested in whether the rails culture is different from the ruby culture.
He is playing a dvd titled “the art of the violin”. The clip talks about the difference between violinists and pianoists. Pianoists have a harder time making music than violinists. Or is it the other way around?
David thinks that rails is in the piano camp, because rails justs gets out of your way and let you do what you need. These same traits have been said about ruby for many years.
David likes the syntax, look, and feel of ruby code, for example no punctuations, underscores as opposed to camel case. ruby tends to have a more “laid back” quite look. Ruby seems to be based off a small set of principles, nice and clean.
Class methods are misunderstood by many people, along with class variables. Class methods in Ruby are the sum of 2 fundamental principles:
objects can have their own methods + classes are objects = classes can have their own methods.
Then he gave some code examples.
obj = Object.new
def obj.talk
puts “Hi!”
end
obj.talk # => Hi!
myclass = Class.new
def myclass.talk
puts “Hi on behalf of this class!”
end
myclass.talk # => Hi on behalf of this class!
class MyClass
def MyClass.talk
puts “Hi on behalf of MyClass!”
end
end
MyClass.talk => # Hi on behalf of MyClass!
The rails code does not fight with ruby, but insteads brings things back to simplicity. Even though at times the backend code of rails can get very complex, what it exposes as an API is simple and belnds back in with ruby. Rails feels continuous with ruby.
You can get a discount for the book with discount code CanRails35, you must order at: http://secure.manning.com/black only valid for a little while.
QA:
how do you hide complexity like people do in Java?
David said: There is no complexity in ruby, but seriously, he doesn’t write java.

day 2: Thomas Fuch's talk (0 points)
in rails, canadaonrails, ajax by jtoy on Fri Apr 14 11:58:51 -0500 2006

Advanced Rails AJAX techniques from Thomas Fuchs
Thomas works at Wollzelle and is a core rails team member.
JS by itself to use is a pain and so we need tools.
Some features of Prototype:
$ and $$: $ is used to reference an element by id while $$ is used to reference an array of elements. Very useful for shorter and concise writing.
Prototype has Events, but most people don’t use them.
Some features of script.aculo.us:
visual effects, drag and drop, ready-to-controls.
There is a JS unit testing library and DOM builder.
About RJS:
The goal is to try to make the web snappier. RS was added rails code at March 28, 2006. With RJS, we don’t need to write our own JS because ruby generates it for us. WIth RJS, we can keep all of our code in ruby to make things simpler.
Example:
page[:cart].update render(:partial => ‘cart’)
page.select(‘p.hint’).each do |hint|
hint.VisualEffect :highlight
end #this code will generate JS
Sam Stephenson (author of Prototype) is a magician!!
Some of the RJS methods are:
page_replace_html
page[:list].reload
You can also use Prototype’s advanced enumerables: page.select(‘p.hint’).pluck(‘t’,’offsetTop’)
You can also add your own raw JS inside the RJS templates.
You can also use render(:update) to do some RJS from the controller.
Helper methods can be called from inside RJS files.
So how can we debug all of this?
use firefox with firebug and the web developer extension. Venkman is also very good. Tamperdata can change data before actually sending. Always make sure you test with all browsers you want to support. Safari has a tool called the “Safari Web Inspector”. IE has a script debugger, but it is very old and won’t be updated.
Thomas then gave a demo of fluxiom.
“Security is overrated!”
Thomas isn’t using Selenium.

day 2: rails engines from James Adam (1 points)
in rails, canadaonrails by jtoy on Fri Apr 14 13:05:15 -0500 2006

rails engines by James Adam
James works at a media buying agency with 700 people, 5 of which are developers. James works on “enterprise” applications and does services as opposed to products. Often he works on many applications for clients simultaneously. Many applications have lots of code that is repeated between applications. Someone said to James “Reuse is overrated” and he believes “Reuse is essential”. There where lots of code that James had to redo over and over.
Does standard rails comes with tools to help you reuse code?
It has generators. You can also write your own generators. You can use gems to package up your generator and share code with people.
James could not use generators because each generator was a little different for each project, so he needed to find a different way to do this. There are also plugins. You can use svn externals to make the maintainable. One issue is that you cannot easily share views or public assets such as css and images though. You also can’t easily share migrations with plugins. So you can only share code with plugins.
So then here comes engines:
Engines are plugins.succ
They are a mechanism to share slices of rails, which includes views,controllers,models, db migrations, and public access. When the rails app starts, the Engine mirrors the public folder for the particular engines to the main public folder. You can also generate engines. You can also overwrite any functionality over the engine code so you can have custom code over your engine code. Any code in the main application will override the code in engines and this also applies for views.
You can see the code for engines at:
http://svn.rails-engines.org/plugins/engines
Recap:
engines are a mechanism for sharing maintainable code between your apps. In the future, rails engines will have bundles. There will also be a happy coexistence with rails core.

Day 2: gruff graphs from Geoff (1 points)
in canadaonrails by johnli on Fri Apr 14 14:01:22 -0500 2006

Gruff Graphs for Ruby from Geoffrey Grosenbach.
There are several libraries you can use for generating graphs. GnuPlot is an application you can use to plot a lot of information.
ruby has a gem: gem install gnuplot
For rails app, gnuplot has too many dependencies.
There is also MRPlot, but it has not been updated in over a year. The code for MRPlot is overkill though.
Geoff wrote sparklines and gruff. Sparklines is for very small graphs. Gruff is a full library for graphing in ruby. It is customizable and can make many different graphs. You can gem install gruff. The code is compact and works well with rails. You can also uses rails’s caches_page to cache the graph. If you use caching, you need to make sure you should use some of the rails helpers, otherwise rails will try to add a .html to the end of the cached file which won;t work for images. Gruff is being used on many sites. You can see examples at Rough Underbelly. You can use gruff with script.aculo.us together. Support for SVG in browsers is flaky. Gruff supports many different image types.

Amy Hoy: Getting started with AJAX on Rails (1 points)
in rails, canadaonrails, ajax by jtoy on Sun Apr 16 22:07:57 -0500 2006

JS used to be the enemy, but now its cool. Why?
There are several reasons:
There are professional tools
Good support
And lots of publicity.
AJAX does not require XML. AJAX is only AJAX if there is round trip data, otherwise it is just plain JS. Then Amy gave a demo of Rails’s AJAX code and support.
RJS is a new feature of rails 1.1, it used to be available as a plugin, but is now part of the Rails code. Troubleshooting Rails can be a pain, but with Firefox, you can use bunch of tools to help you. The web developer plugin is a powerful tool. Firebug is also another tool.

Alex Bunardzic and Less Technology (1 points)
in rails, canadaonrails by jtoy on Sun Apr 16 22:17:16 -0500 2006

We need a language that is good to humans not machines. Humans make mistakes though, so how can we have a language that deals with testing, rounding errors, and other machine related problems?
Currently there is no one technology that can do this for us. We need “smart servants”. “Less code” is bettern than more code. Ruby and Rails promote these kinds of ideas. Software currently ats as a middle man between humans and machines. We need languages that are more expressive than Ruby. Ruby is currently one of the most expressive languages, but there is still room for improvement. DSLs are also helping to make programming more expressive.