I’m currently getting acquainted with JBoss, SpringSource Application Platform, JBoss Seam and Spring Framework.
One thing that amazes me is the amount of code required for some simple O/R mapping, or I am missing something? I hope to be wrong about this, but it seems like an EJB3 "entity bean" requires, for each column in a database, the following items written and maintained:
- a private member variable
- a getter method
- a setter method
As I have some Ruby on Rails experience, where inheriting from
ActiveRecord gives you those things out-of-the-box, I am amazed of the sheer amount of boilerplate code needed in Java for the same thing! I asked a friend wih ZendFramework knowledge about how it worked there, and it seems like
Zend_Db_Table_Abstract works just like
I can’t be the first one perplexed by this, especially not when the development guide for the ASM 3.0 Java bytecode engineering library contains exactly the above parts as an example of generating bytecode! (See section 3.1.3.)
In order for someone to give The Project (Min Packning) a try it was required to register an account and provide a valid e-mail address. This is an obstacle, so I wanted to add a way for people to try the service without registering. It was actually very easy. I created a demo user account, added a demo method to SessionsController and added suitable routing. Now visiting www.minpackning.se/demo will give a logged in session as the demo user.
params[:login] = 'demologin'
params[:password] = 'demopassword'
map.demo '/demo', :controller => 'sessions', :action => 'demo'
According to the latest mail I got from The Pragmatic Bookshelf, one of their upcoming titles is The ThoughtWorks Anthology, but I couldn’t find anything about it on the web. Out of pure curiosity I’ve sent an inquisitive mail to see if I can find out more about it. Maybe it’s related to the No Fluff Just Stuff books?
Another upcoming book is Facebook Platform Development with Rails, which sounds nice but I’ll probably never get around to do it… 🙂
Update Andy Hunt kindly replied to me:
It’s a collection of essays from leading ThoughtWorkers. We’ll have an announcement up in the next week or so.
Probably years after everyone else, I’ve made my first AJAX-enabled web page today. As I do this from within Ruby on Rails, it was virtually painless to remove or replace a piece of HTML.
My next AJAX step was to get in_place_editing working. The first problem was the InvalidAuthenticityToken and the second issue was that I use a different controller, but now it works fine!
The Project will allow users to create and edit something I call “Things” in this article. One feature that is quite high on the priority list is to be able to print Things. I found the article “Print this page” with Ruby on Rails but I wanted a separate page for printing a Thing. I have created a layout called “print” and my ThingsController contains a method like this:
@thing = current_user.things.find(params[:id])
render :layout => "print"
My routes.rb contains something like:
:controller => 'things', :action => 'print'
The print layout is currently bare-bone HTML with this script snippet right before </body>:
I found a suitable initial web design for The Project at Open Source Web Design. That’s a really great site!
Now I’m learning about layouts in Ruby on Rails. As suggested in the Midnight Oil blog (Beds are burning?) article SimpleSidebar – If you have sidebars, you need this plugin I now use SimpleSidebar in The Project. At first it didn’t work at all, but updating config.plugins in config/environment.rb was an easy solution! 🙂
Zed Shaw rants quite a bit, stating that Rails Is A Ghetto. Most things I read about RoR are good things, and I guess that some of it is written by the people that Zed grumbles at. It is quite refreshing to hear other opinions, even if they might not be what I want to hear.
I just read that David Heinemeier Hansson, of Ruby on Rails fame, also was born in 1979. He took a very different route, but he is probably more of an entrepreneur than I am.
Today I will move to another project at the client’s department. Change is good! 🙂
Yesterday and today I took some time to work on The Project. (Tomorrow I’m back at work, so much for a holiday project.) I tossed aside requirements on a strictly Swedish interface, so the controller names are in English and I don’t use Ola Bini‘s Swedish Rails yet. Honestly I haven’t done any TDD/BDD yet either. The excuse I tell myself that I only cannot learn everything at the same time.
I lookup things in the Rails 1.2 book but as I’m using Rails 2 I’m browsing the web quite a bit too. One very useful resource I’ve found so far is Akita’s tutorial. So far I have restful_authentication working (from the restful_authentication gem), a “welcome” controller and two domain-specific models. I’m working on two related controllers.
A few words about using an activation step when registering a new user. I started out with the Restful_authentication & Activation instructions but I thought that having a HOST global variable was really silly so I found the retardase_inhibitor plugin and now I can properly generate URLs in the ActionMailer.
Bruce Eckel recommends Peopleware — Productive Projects and Teams (by Tom DeMarco and Timothy Lister) in his recent weblog entry The Mythical 5%. When I ordered a bunch of book recently I was thinking of including both The Mythical Man-Month by Frederick Brooks and Peopleware, but I didn’t. It is probably a good idea to read both of them again as I haven’t read them for five years or so and I’m trying to be one of those 5% mentioned by Bruce Eckel…
I have plenty to read anyway though, and yesterday I spent some time on my latest project. I want to use Rails 2.0 but I keep Googling and reading pages like Rails 2 Upgrade Notes a lot when things don’t work exactly as they did in previous versions. A complicating issue is that the web interface for my project will be in Swedish so I will give my controllers Swedish names, but I want English names in the database so it will either be a kind of mix under the hood or I’ll use set_table_name in the models. I hope that Swedish Rails can help me out a bit!