Posted by: Ivko | March 22, 2010

Choice of the week – 11/2010

Is Java EE 6 too complicated?

The people who back and evangelize Java EE 6 are very active the last few weeks. The blogosphere is full of posts, articles and  webcasts on how easy it is now to develop with Java EE 6. The reason for that I guess is that most of the people still think that Java is too slow to run and Java EE is too horrible and complex to develop.

Well, not that I have done much of EE development the last couple of years, but I can only agree with people like Adam Bien. The different technologies in the EE stack are so well integrated now and the tooling (NetBeans, Eclipse, IDEA) is so well designed, that you can develop and deploy a simple web application in no time. If you don’t believe my humble opinion, you can follow Adam on twitter.

By doing this I came across the short article, which I want to present you hereby. If you still have your concerns on Java EE’s horribleness, please do read the article and the comments below. It’s quite interesting.

Weld, JSF 2.0 and Google App Engine, part 2

Some time ago I recommended you reading the first part of this short series, where the author guided us in developing a simple web application, that is using Java contexts and dependency injection’s reference implementation (Weld) and JSF 2.0. The most interesting part was that it was configured for and deployed on Google’s cloud offering – Google App Engine (GAE for short).

In the second part the author focuses on several little details that would make your application run better on GAE. It includes database access optimization howtos, security, caching, JSF, logging and also a list of unsupported features. This is very important for those of you who have chosen GAE as deployment platform (for small sites with little traffic it’s perfect as it is free in such cases).

Using Spring Security and Spring Remoting together

In this short article you can see how to wire and configure two of spring framework’s libraries – Spring Security and Spring Remoting, in order to run an application that exposes a web service on the server side and accesses it from the client side.

The Spring fans are a little bit quiet these days, but nevertheless Spring framework remains a full featured application stack that can be used for rapid and reliable application development both for the enterprise as well as for the home users. BTW this week I came upon this presentation about Spring DM server. It is something like a true Java EE application server built on the OSGi technology. It has bundled all the necessary Spring libraries as well as all kinds of dependencies that you normally pack when you are developing a web application on Tomcat. And it does all the dependency injection and provides you all the helper classes that you would need to handle the resources through the whole stack of your application. And it is now free and open source, and it is part of the Eclipse projects.

Wow, enough of Spring evangelizing from my side🙂.

Levels of REST architecture

Martin Fowler has a very interesting approach of describing what REST is. It is actually inspired by a book on REST, which is in the process of writing and by a REST model that was presented elsewhere.

Martin develops the REST idea through discussing the implementation of a simple use case where he looks for the vacant hours of his doctor and tries to book one. The implementation goes through three levels of REST-fulness so that the reader can fully understand all the concepts of the protocol – resources, actions (or verbs) and resource representations.

Memory saving pattern: object list

Finally something in the core java area. Although it does not happen very often, we sometimes need to create a complex “multimap”. Author’s use case was a map, which values were lists of objects. The objects themselves were tuples of a String and int.

The author tested the performance and the memory consumption of three implementation of this structure. He first created a StringAndInt class that contains the tuple’s two properties. Then he checked how a HashMap that has a value ArrayList of this class performs in terms of memory. Next he tried the same thing, but instead of ArrayList, he put the new class into an array. The difference was quite small.

Finally putting the array inside the class (StringAndInt class containing arrays of ints and strings) improved much the performance. Why? Try it or read the article and you’ll find out.🙂

Introduction to Mercurial

The distributed version control systems (like Git or Mercurial) are very much discussed and used these days. Shortly after announcing his “retirement” from active blogging, Joel Spolsky contributed this very helpful introduction to Mercurial.

It starts with a chapter for developers like me, that are used to the Subversion style of work. Well, people, if we want to be cool, we have to change our mindset. The least thing that we will get is committing at any time, from any place (even the plain) without bothering of breaking other people’s work or needing network access all the time. What else do Mercurial and other distributed version control system provide? Well, read the introductory tutorial…🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: