Java Web Frameworks

We have had a couple of interesting presentations at CJUG in the past few months.

In July we had a presentation on Play, which seems to be getting some traction.

In August, we had Igor Polevoy from Productive Edge talk about is new framework ActiveWeb. Like Play, Rails and Grails, it is full-stack. Last year he gave a presentation on ActiveJDBC, an ORM framework he started based on ActiveRecord. The mailing list gets a few dozen posts a week, so it looks like there is an active community of users and developers for it. He said that his company has been using ActiveWeb for a few clients, including a couple of Fortune 500 firms.

First off, it is nice to see that there are some Java projects coming out of Chicago. It is also nice to see that there are some Java web frameworks that are striving for the ease of use and completeness of Rails and Grails.

Image from CJUG website, assumed allowed under Fair Use.

Adding Some XML To Netbeans POM Files

I am working on a small program with Netbeans. I chose to make this project a Maven project. But when I ran “mvn compile” on the command line outside of Netbeans, the program would not compile.

After doing some searching, I found that I needed to add some XML to the POM file:

It would be nice if Netbeans just included that automatically.

It is interesting that IDEs now support Maven, and that Maven is getting a lot of traction in the industry. When it first came out, people thought it was too restrictive, and now “convention over configuration” is the rage. A lot of people looked at it and thought, “Why do we need this? We already have Ant.” But it looks like Maven is overtaking Ant. (This is a subjective, anecdotal observation.)

Image from Wikipedia

CJUG June 21 Wrapup

Thanks to everyone who came to tonight’s meeting, to CME for hosting, and to Andrew Lee Rubinger for a great presentation.

You can find Andrew’s code at https://github.com/alrubinger, and his other links at http://about.me/alrubinger

As someone mentioned at the meeting, there is a JBoss User Group: http://www.meetup.com/ChicagoJBUG/

In the next few months, we have presentations scheduled on the Play Framework, the ActiveWeb framework, and JDK 7.

Now that I think about it, I should have asked him why Arquillian uses an alien for its logo.

Image from Arquillian website, assumed allowed under Fair Use.

Looking at Project Lombok

My look into concurrency continues. I am messing around with some of the comments that I have gotten from my posts on LinkedIn and Stack Overflow.

I also found a project called Lombok, named after one of the islands of Indonesia. It uses annotations to replace a lot of boilerplate in Java for a few tasks, including threading. It can handle getters and setters, equals and hashCode and logging as well as synchronization.

A few of the forums that I have been on have recommended looking at something other than the “synchronized” keyword, which Lombok seems to rely on. But it is still worth looking at.

Image from the Wikipedia page for West Nusa Tenggara, the Indonesian province which contains Lombok, assumed allowed under Fair Use.

Update On Concurrency

I still plan on posting more on concurrency. I made a small Java app to test out a few ideas.

Some of the discussions on Linked In had died down, but there were a lot of replies in the past few days. I am getting some contradictory advice. It seems like the more I read the more complicated it gets. This is making Actors look more appealing.

Do all languages have multiple ways of approaching concurrency, or just Java? It seems like other languages don’t deal with this stuff. I am surprised there are not three Thread pool wrapper libraries at Apache.org. Usually they solve a problem in Java three ways.

Image from Wikimedia, assumed allowed under Fair Use.

 

Play: Yet Another Framework

Last night I went to the meeting for the Chicago Groovy Users Group. The presentation was a web framework that uses a bit of Groovy, but uses a lot more Java called the Play Framework.

Does the world need another framework? Maybe not. But this one looks interesting. It is a lot like Ruby On Rails, or Grails. You do a lot of stuff from the command line, and you do not need to restart to see your changes. It is REST based, and everything is stateless, so it is easy to scale. It uses “convention over configuration,” like many other frameworks.

I guess there is interest in getting Scala to work with Play. I do not really see the point of that. Scala and Groovy moved a lot of the boilerplate of Java into the languages, while Play seems to move the drudge work into the framework.

And, of course, I asked the speaker to present at CJUG.

Image from Play Framework website, assumed allowed under Fair Use.

Update on Concurrency

I posted my last post in a few LinkedIn groups. I got a few responses, some of which have led me to more questions. So I may post some follow up questions. Then I will try a few more of the groups.

In one of the groups it got deleted. I have no idea why.

I also got a link from one of my Twitter followers (a lovely young woman in Tunisia) to an article about GPars, an Actor library that can be used from Groovy or Java. I will look into that at some point.

First Concurrency Technique

In November 2009 I went to No Fluff Just Stuff. One of the presentations was by Brian Goetz, which was about Java concurrency. For some reason there were items on his agenda slide that were not covered in his presentation.

He went over some strategies, and at the end he pointed out a common tactic that he also said is a good rule of thumb for concurrency in Java: Make your variables private, and make any methods that access them synchronized.

That sounds pretty simple. And perhaps too good to be true. I will post on some forums and boards populated by people with more knowledge than me if there are situations/applications where this concurrency technique would not be sufficient. Would relying primarily on this technique work well in systems with lots of transactions, or large data sets? What are the potential drawbacks of doing this?

Image from Wikimedia, assumed allowed under Fair Use. Image from the Vatican Virgil, a 5th century manuscript of poems by Virgil.

Posts About Concurrency

I have decided to make some posts about Concurrency.

One of the gaps in my Java knowledge is concurrency. I think I have lost a few job opportunities due to my lack of concurrency knowledge. (There are a lot of trading firms here in Chicago.)  Sometimes I think concurrency is also Java’s Achilles’ Heel as well as my own.

I have noticed on some Linked In groups and forums that a lot of managers and recruiters have said it is hard to find Java developers with good concurrency knowledge. The reason is that a lot of Java developers make web apps, and they let the application servers and servlet containers handle concurrency. Part of me thinks is the smart way to go. Threading is hard. The JVM handles memory for you; why not let something handle threading for you?

Anyway, I think I have learned a few things about concurrency. So I will write a few posts about what I know. I will look at some techniques, libraries and languages.

Image from Wikimedia, assumed allowed under Fair Use. Image from the Vatican Virgil, a 5th century manuscript of poems by Virgil.

JPasswordGenerator Review

One of the things I have planned for this site is to talk about some Java apps that I use.

One of them is a password generator called JPasswordGenerator.

I was listening to Security Now with Leo LaPorte (who runs several podcasts on the TWiT network) and Steve Gibson (famous for the firewall tester Shields Up). On one episode they talked about another one of GRC’s services called Perfect Passwords. Every time you refresh, it makes a unique set of passwords. I liked it, but I also wanted to use something local that used Java.

So I did some searching, and I found JPasswordGenerator. I liked it, and I use it whenever I need a new password. (I use the Bruce Schneier technique of writing them down and keeping them where I can keep them). One thing I like about it is that I can select which characters that are in the password. You can put the section sign in the password, but my keyboard does not have the section sign, so I disable that. You can also select the length.

The only issue is that I have had to write some scripts on both Linux and Windows to run it. For some reason I could not get it to run with the scripts that came with it. All my script has is “java -jar JPasswordGenerator.jar”.

So if you are looking for a good password generator, try out JPasswordGenerator. If you know of any others, let me know.

Image taken by author. Image is a screenshot of JPasswordGenerator, site here, Sourceforge project here, assumed allowed under Fair Use. The project has not been updated since about 2011, so I think we can say it is abandoned.