Effective Java 2008: a must have for 1st edition readers (an not only for them)

I have read last week end the second edition of one of the most famous Java books.

I loved the first edition, and I love even more this second shot. It have the same good layout of first edition, organizing arguments in chapters and items, with clear explaination of goals and pitfalls,  very informative and stimulating. What is changed in this second editon? Not much and all at the same time, since Bloch have added items dedicated to Java 5 and 6 new features, and he reviewed about all contents updating it, giving even more ideas.

Yep, IDEAS. It’s the great plus of this (and few others books), it give you ideas and stimulate your own thought and investigation instead of just explain author’s point of view.

IMHO the first edition have been one of most important books in java initial success in fall 2001. I’m not sure this second edition would become so much important for this new Java developer generation as it was for my generation, but in my humble opinion they should read it. And not only them, but also for older boys like me.

In 2001 Java was different, java community was different, and I was different too. I was a young developer who had just moved to java (my first serious enterprise project had started in late 2000), java is a fair new language, with an enthusiast community. Today Java is much more consolidated, even if it’s starting to demonstrate some oldness symptom. Today Java community is much bigger, have provided great libraries and have guided some of best evolution of the language, maybe  a little less enthusiast. The new edition of Effective Java reflect all this points, and it’s important to keep it’s value: helping reader to think and get ideas.

And how am I changed since 2001? Well I’m now a software architect (the right kind of architect :) ) coaching about 20 developers and managing bigger developments and environments. I’m not changed too much: I still be enthusiast, I still be a developer and a technology passionate. What is changed is my point of view. As architect and (agile) coach I read this book thinking how great or bad code can influence my system, eventually enforcing or breaking my design. Reading this book I thought about how design is important at any level, but probably what really make a system successful is design at lower level, in other words fine design made by any single developer. It’s probably the main reason for which architect have to write code and coach have to consider its team as a chain: strong as its weakest link.

Groovy, Ruby and friends success would benefit a lot from a book like this one written for them. I don’t know nothing around similar, someone have suggestions about?

My favourite 3 items in new edition are (not easy to select just 3, but I’ll try):

  1. Item 2: “Consider a builder when faced with many constructor parameters”. why? Because in a lot of case it’s better to have readable code than performance or compact code. Frankly Java doesn’t help too much…so patterns and best practices are important.
  2. Both Item 15: “minimize mutability” and Item 40: “Design method signatures carefully”. No comments needed right? :)
  3. Item 26: “Favour generic types”. Generic types are very expressive, compact and flexible. Not so easy for all people, but too powerful…insist with developers to design generics type!

Well a special mention to chapter 10 “Concurrency” to few developer use concurrency effective…it’s the god and bad of J2EE…but real developers should design at least a serious concurrent application to perfect their skills.

Your preferred items?

Funny timeout

Something happen at the office some days ago:

phone ringing

me: “Hello”
other: “Hi, I’m ***, I’m testing your webservices to implement X function of your B2B process”
me: “Ok, and…?”
other: “I’m getting timeout immediately”
me: “well timeout and immediately, seems two words in little contrast…” (some ritual questions about framework used, setting and so on) and finnally
me: “did you force a timeout client side?”
other: “Yes I set it at 300…but I get immediatly timeout”
me: “Immediately….. like 1/3 of second?”
other: “I don’t know…but I set it at 300 seconds, I’m not a newbie”
me: “No for sure, but may I ask if you sure they are seconds…..?”

ROTFL, sure he isn’t a newbie just a ……(put here what you want)……

Well, needless to say the answer about which framework he is using have been “.NET of course”. Yep of course :)

SOA and heterogeneous technology environmet: eggs and chicken problem

One of the use case for witch a SOA (ESB) solutions is recommended is when you have to manage a complex “technology heterogeneous” environment.

Well, I’m thinking about a good design for some new important feature to be added to our complex environment. Our environment is indeed complex, with wide impact, with heterogeneous needing, but it is quite homogeneous in technology. OK, it isn’t a monolithic system, it is build by a lot of part, but a lot of this part are java(2ee)/oracle based.

But the question is:do I like to keep my system so homogeneous? IOW if I invest a lot of money adding these new features to my system, which involve to use/review most of developed software, is it really the right choice to keep it all based on java?

I’m a java guru and fun using it as my main development language in last 10 years, but my answer is

NO

Why NO? Because if I take a look behind in the past I can see a lot of system architects answering “yes!” at same question 20 years ago substituting “Java” with “COBOL”. And a shudder come on my back…would I really sentence my system to be so strictly coupled with a single technology and loose flexibility and cool feature of newer technology? I’m not sure Java will become the next COBOL going to be static and legacy, but for sure, if I would answer yes I would be disown my ideas of “open system”.

There are so good languages and technologies kicking around, which probably solve better some kind of problem. Groovy, Scala and Ruby are the most famous, but we have also Erlang, Factor (with good ideas and a friend of mine behind), and even more legacy language like perl could have its place in some specific use cases. In general if something could be more productive or more flexible than java for some specific problem, I’d like to keep doors open. Randall did an interesting post saying java developers should learn other languages, I make a step over saying java developers should USE other languages

I’ve been always open to new technology and solution, would I miss my freedom of choice in favour of my beloved language? No, my freedom is much more important than java :)

Designing my new system I would use best technology and language for each part of the system. It’s always a good decision, the good news is integration of these parts could be seamless and painless, we haveSOA/ESB solution.

My conclusion is that isn’t necessary to have heterogeneous system to go for SOA, probably is the contrary: nowadays we need heterogeneous system to be time to market, to have easier maintenance, and so we need SOA to build and manage it.

SOA and heterogeneous technology environment seems to be the  eggs and chicken problem :)

Thoughts?