Archive for May, 2008

How I got a job at Apple …

Friday, May 30th, 2008

steve-jobs

I have very vivid dreams and I remember them rather well and in detail. Last night I had a dream and it involved Steve Jobs, let me explain …

A group of people and I were traveling on a bus through a nice forest like country side high on a hill when we came to a very large waterfall. The bus went near the edge of the water fall on top of a large sheet of glass, enabling the bus to get close to the edge and for all the passengers to enjoy the view. The bus started to slide on the glass and it plunged off the edge of the falls and lodged between some trees and a cliff with the front of the bus in the air and the back of the bus closer to the ground. No one was hurt but we had to get out quickly because the trees holding the bus were creaking and we felt the bus could plunge further any minute. Everyone got off the bus including me or so we thought, until a few faint squeals came from a boy in front of the bus too scared to move. I went back onto the bus and grabbed him and took him to safety.

We mustered together and walked through the forest for a while and came upon a large house with nice grounds and a tranquil feel. There were seats on the ground and in front of them a banquet and we all sat down and started to eat. In front of me only a meter away was a separate seat and to my amazement sitting at it was Steve Jobs and his wife. Steve stood up and said he would rather sit with all the other people and he came and sat opposite me. I was rather excited by this.

I asked Steve what he was doing in this place and he said he was searching for someone to help him build the next big thing at Apple. I then asked how he would know when he found that person and he looked at me calmly and said, “they will have a white ball”. I have always been excited at the prospect of meeting and working with Steve Jobs and Apple and looked around me quickly to see if I could find a white ball. To my amazement I was sitting amongst thousands of them which I had previously thought were lotus leaves, so I picked one up and handed it to Steve, who looked back at me with a confirming grin. A tear came to my eye.

I was hired.

I’m at a loss to say what this means and if you have any ideas, please let me know.

Don’t Click … Can you do away with clicking?

Monday, May 12th, 2008

Pointer

User Interfaces, Design and interaction interests me and I stumbled across this web site http://www.dontclick.it/ where they experiment with an interface that removes the need to click a mouse button.

Very interesting indeed.

Come on Java closures …

Tuesday, May 6th, 2008

serving

I can’t wait for Java closures because they will make our code simpler and cleaner. For example, we can replace

FileInputStream input = new FileInputStream(fileName);
try {
    // use input
} finally {
    try {
        input.close();
    } catch (IOException ex) {
        logger.log(Level.SEVERE, ex.getMessage(), ex);
    }
}

with this

with (FileInputStream input : new FileInputStream(fileName)) {
    // use input
}

AWESOME !

(The example above was taken from Neal Gafter’s Blog.)

Closures would have made the code in my East example more clear too.

A Fully Personal Interface …

Monday, May 5th, 2008

rocks

So what interfaces do users really want and what do they really like ?

Over at Fully Personal Interface they are finding out with a verify interesting survey on different aspects of ‘interface’ and you can see a report on them. Please take a moment to take the survey.

When I visited the site I was survey participant 2010.

Also check out this good eZine on making your life easier and your interfaces, called Smashing Magazine.

SEAM: Weaving the layers …

Friday, May 2nd, 2008

which-box

For a short while I have been looking into JBoss Seam and working through the examples and coding my own project.

My last few projects were Spring/Spring MVC based and architected with distinct layers to keep the code clean and focused, and I wondered how Seam supported this approach. Initially I thought I could just get Seam to inject the items I needed to form different layers and it does, but this isnt idiomatic Seam.

I think it is important to understand the idioms of a framework so you understand how it is intended to be used and therefore get the most out of it. So I posted a question about layering to the Seam Forums.

There were a couple of responses but one in particular from Andy Gibson spelt it all out so clearly that I had to post it here, since it applies to a wider audience than just Seam users.

 

Hey James,

Shane is right, it really depends on the application context. Another important factor (I think) is whether code is going to be re-used later on, either from another point in the same application, or from another client elsewhere.

These things can always be refactored out later but if you know about it ahead of time, it can impact design decisions earlier.

The first major layering decision though is whether to mix business logic and view logic in the same session bean. A lot of times we’ll see code to handle button clicks in the same bean as the code to perform actions on entities. If we want to perform the same actions from other places in the code or even other applications, we may want to separate that out which is fine.

You can further demarcate the layers based on state and function. The ‘backing bean’ session beans can hold the view state and logic, but any general functional code can be placed into stateless beans which have state passed in to them.

The obvious benefits are that we put the method in one place and always use it to perform that action so if we decide to change it, or always send an email to someone when that action is performed, we can just put it in that one method.

This is probably obvious to many as it is just good OO principles, but Spring always seemed to to put as many layers in as possible because of the (overstated IMO) need to change any layer at any given point in time. We started with MVC, and then Spring threw in service layers, repositories, Daos and so on.

Seam is a little different, especially since it is based around a stack that probably 80% of people are going to use anyway, hence no need to swap out layers. With Seam you can just put layers where they are logical, or it is prudent to do so.

Cheers,

Andy Gibson

Seam handles the weaving (I had to get in a sowing term) of web and services so well that the need for heavying layering is removed, at least for the immediate development. However, I am still a little weary of putting EntityManager interaction logic across more than one class and still choose to put this into a Repository object that is in turn injected into the Action/Service.

Happy seaming !