Looking at the implementation, though, leaves me cold. Let's look at a code snippet:
def read(name, options = nil) super @ether.get(name) end
With some commentary:
Invoking super for each method call ensures that the proper messages get logged for each action
Wow, way to trust your users! </sarcasm> Requiring a call to super is very bad practice. Any time you are relying on a client of your class to call something, you're risking someone forgetting to make the call.
It's better to use the Strategy Pattern. Here, you finalize the API method (here it is read) and provide an abstract method or your subclasses. Marking the method as final (which I don't think you can do in Ruby, but I digress) ensures that a subclass can't override your functionality, and the abstract internal metho…
UPDATE: Everything works now. Turns out I had a plugin installed that monkey patched the SQL Server Adapter. This plugin was from an older version of Rails, and the Rails 2.0 adapters now extend from AbstractAdapter. Fixing the parent class in my plugin monkey patch (to extend from AbstractAdapter) fixed this up and now I no longer get the error.
I just installed the SQL Server Adapter Gem from gems.rubyonrails.org for my new Rails 2.0 project:
When I attempt to use it, I receive this error message:
TypeError: superclass mismatch for class SQLServerAdapter from /var/lib/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:190 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require' from /home/sladd/development/workspace/DSES2/ve…
Artima has just released a pre-release copy of Programming in Scala. Much like the Pragmatic Programmers handle their book publishing, you can buy the pre-release copy as a PDF now, and Artima will provide free updates as the book progresses. You can choose to purchase just the PDF, or the PDF/Printed bundle.
Scala is a really fun programming language, combining object oriented and functional aspects into one dynamic and powerful package. Best of all, Scala runs on the JVM, so it can take advantage of the entire Java ecosystem.
If you're interested in functional programming (and you should be) but don't want to completely abandon your investment in OOP or in Java, then you need to give Scala a look.
One of my favorite features of Scala is the Actors support. You can use Actors to achieve Erlang style concurrent and scalable systems on the JVM. Now that's hot.
When Douglas Crockford talks about Software Quality, you should listen. If you are involved in writing software and need to understand why software is difficult, or if you are planning a software project, you need to watch this presentation.
Includes such gems as "No rational person can do software", "Programmers don't understand how they spend their time", and "If you took all the code you wrote over the past year, you could probably type it into the computer in one day." One of my favorites: "Programming is a social activity."
Oh, and mad props to Crockford for drawing a parallel between building software and Mr. Blandings Builds His Dream House. Not only is it a funny movie, it's one of my Mom's favorites. While Crockford found many apt parallels, he unfortunately was wrong about one. Software construction is not nearly as funny as this movie.