Ruby on Rails his mainstream IT news

News.com has an article about Ruby on Rails this morning, bringing RoR into the mainstream news, and possibly giving it the attention that I think it deserves in terms of simplifying web application development.

The article gives an overview of the deverloper, David Heinemeier Hansson, and a brief overview of what RoR is about. This should move RoR onto the radar of significantly more people, and may start up more interest in this relatively new framework.

Java only uses pass by value

There is a discussion on the JavaLobby site about an article written on the javadude.com site explaining how Java only uses ‘pass by value’, and never ‘pass by reference’.

I’ve know this for a long time and blogged about it here in my Java section with what I think is a clear explanation of the sematics of pass by value verses pass by reference.

The point is, although Java has references (everthing that is not a primitive is a reference), all parameters to methods are always passed by value. There is no pass by reference in java. The confusion is in the names being used here, because references are actually passed by value.

If you don’t understand this, look at how parameters are passed by reference in C, and write some code that swaps a parameter passed for another, and how it changes the value being pointed to by the orginal parameter before it was passed to the method. You cannot do this in Java. Java only passes by value.

Article: ‘Component Inheritance in EJB2.0’ – making excuses for the flaws in EJB2.0

This article on ‘Component Inheritance in EJB2.0’ on the java.net site attempts to give an explanation and make excuses for why the EJB2.0 spec is so fatally flawed. This is an interesting article because of the spin that the author takes – it almost sounds like he is making excuses for the flaws in the EJB2.0 spec and to justify why it is actually ok.

The author makes a statement that the reason why Entity Beans do not have inheritance is because they are misunderstood and are actually ‘componenents’ and not objects. Well a component can be different things to many people, but an Entity Bean as a component is a very fine grained component if you ask me. The author states that therefore it is ok that Entity Beans do not inheritance because a component does not represent state of an object.

This is nonsense. An EntityBean is intended to represent an Entity in a system. An Entity, as an Object, has State and Behavior. When I model my application, I identify types and subtypes and the relationships between these types and implement them as Classes. The reason why (one of the reasons why) EntityBeans are flawed is that I cannot implement EntiyBeans to represent the data model that I have jsut described – this type of data model is natural to implementing an Object Oriented system using an Object Oriented language such as Java. To have a persistence mechanism that does not support features which are core to the language I am using to implement my system is just nonsense. This is the main reason why the EntityBean part of the EJB2.x spec is flawed.

The POJO approach in Hibernate (and other ORM tools) is the correct approach in my opinion, and the reason why this approach has now been adopted for the EJB3.0 spec moving forward. Don’t make excuses for why EJB2.x is wrong; accept that it is wrong and move on – there are better solutions out there.

Nostalgic Computing – buying an Atari 1040ST on eBay

During college in the early 90s I had an Atari ST computer. At the time PCs (286s and 386s) were pretty expensive (I only knew of a couple of other students on my BSc Computing course that had Intel based PCs).

The Atari ST was a 16bit machine, using a Motorola 68000 CPU (same as the Mac at that point in time), and came in two main flavors, the 520 had 512k RAM, and the 1040 had 1Mb RAM. Both has a 720k doublesided, double density floppy disk drive, but no harddrive. The OS (TOS) booted from ROM, and you loaded programs and games from floppies. At the same time the Amiga was the main competitor in the same range of machines, but I think the Atari was more popular in Europe, whereas I think the Amiga was more popular in the US. The ST was originally launced in 1986, so will be 20years old next year!

I couldn’t resist bidding on a 1040ST the other day when I saw a few going on eBay, and managed to win one with a color monitor for 50 bucks. Can’t wait until it arrives and to unpack it and set it up. Not sure what I’m going to use it for at this point (other than re-living some classic ST games), but I may look into getting an ethernet adaptor (some sites have a DIY convertor to add an Ethernet card) and getting it set up to browse the web and access email.

What I found interesting was that the last model in the ST line, the ST Falcon030, is pretty rare, and if you can find one still sells for hundreds of dollars. Not bad for a computing relic. The TT030 although is hard to come by. I would have bid on either of these but couldn’t find any at the time.

Something else impressive – when you start searching on Google you never know what you might find – Best Electronics based in San Jose, still sells ‘new in box’ ST computers for around 300 bucks (depending on the model – they currently have a 1040 at this price). The also have a reconditioned TT030 for $600 and a reconditioned Falcon030 for $800. Wow. Thats more than you would get for a decent spec second hand PC that is only 3 years old. Incredible.