Monday, February 21, 2011

Jumping on the Amazon EC2 Cloud

I've been meaning to try out Amazon's EC2 cloud for a while. I had been looking at tools that make it easy to deploy Java web applications for the cloud like Cloud Foundry or even Amazon's Elastic Beanstalk, but I thought I should get more familiar with deploying cloud applications myself before using tools that abstract some of the basics away from you.

Yesterday I spent an afternoon and was able to configure the following:
  • Launched a virtual instance of a linux distro.

  • Installed and configured Apache Tomcat.

  • Installed a sample web application on Tomcat.

  • Assigned my instance an IP address.

  • Mapped a domain to point at the IP address.

  • Configured SSL.
...and presto! I have an application running on my EC2 instance that uses SSL:

https://www.doulosdev.com/directory/
(NOTE: Might not be up at this moment as I will be bringing it up-and-down!)

I still need to hammer out some kinks (e.g. allow regular HTTP traffic, configure the "www" subdomain, etc.), but not too bad for a cloud n00b! :-)

In summary, take Amazon EC2 out for a spin.

Monday, August 10, 2009

VMWare Buys SpringSource?!

Wow, where did this one come from?! VMWare? And Spring?

I'm a big fan of Spring and the major impact they've had on the Java platform and Enterprise development in general. Rod Johnson's J2EE Development without EJB is still a good read five years later and Spring's response to EJB still reverberates today. I had no idea Spring was looking to be acquired. Wow, Oracle buys Java and now VMWare purchases Spring. What else is going to happen in 2009?!

The CNET editorial in the related links is a good read. The author mentions his previous hope that Red Hat would acquire SpringSource, but I don't think that ever was a viable option for Red Hat. Red Hat / JBoss's philosophy is very different from Spring's. Red Hat / JBoss pushes its own web framework (Seam) built on JSF & EJB 3 as well as its JBoss server while Spring pushes its own lightweight server and Spring MVC among other things. Also, a few years back there was that falling out between Spring and Hibernate with the latter later being purchased by JBoss.

Related Links

Friday, August 7, 2009

Maven Makes Me Feel Like I Have Attention-Deficit Dis... Oh, Look - a Kitty!

This is not a post on Maven-bashing. This is just a post on how Maven keeps me humble. If I ever find myself becoming arrogant or think myself a gifted developer, browsing a "simple" pom.xml file quickly drives those notions of grandeur away.

I just can't muster up the motivation to delve more into maven internals. Sometimes I wake up and say, "Today is the day, I will conquer Maven!" I'll jump on the web and browse through Maven's documentation, but then somewhere around the word archetype, I'll either fall asleep or get distracted.

I've used Maven in a work project for about a year now. Of course, I didn't actually write the pom file. Like most people I inherited it. I browse it occasionally, but then somewhere around "plugins," my head explodes and I start drooling.

Is it just me, but I found my Ant build.xml file a lot easier to at least comprehend. Don't get me wrong - I don't have the knowledge to actually create a build file from scratch. I always started with one that I had done previously and then modified it. Probably the first one I did was just ripped from some online example, which begs the question if somewhere floating out on the Internet is the Mitochondrial Eve of build.xml files...?

I'm not saying that Ant is superior to Maven. I definitely think the two projects are related. Obviously, they are trying to accomplish two different goals...or should I say targets? Heh, heh. Maven just does so much that I get overwhelmed in the details.

Once again, I'm not saying that Maven is evil - I don't have the knowledge to make that assessment. I'm just saying that for me personally, Maven has quite a steep learning curve! If Ant is the Matterhorn, then Maven is Mount Everest. That being said, I'll feel a lot better about my accomplishment after conquering Maven than conquering Ant! :-)

[ DISCLAIMER: This post was made in good fun. The author accepts no blame for possible discussions involving Ant, Maven, or rabid monkeys. ]

Monday, June 29, 2009

Goin' Groovy

Over the past month I've been spending a lot of time w/ Groovy and Grails. So far I'm pretty impressed! Groovy really does reduce Java's "signal-to-noise" ratio (i.e. less code for the same functionality) and the fact that Groovy was designed from the ground up to run on the JVM is definitely a plus for me! Also, the fact that Grails builds on Spring MVC and Hibernate (via GORM) helped me get up-and-running quickly.

A few weeks back I attended a Groovy Code Camp here in Phoenix. One of the speakers said that once you program in Groovy, it'll change the way you think when trying to solve problems. I didn't think too much about that statement, but then the following week he was proved right. Even after only a few weeks of using Groovy I went back to my job working with Java and found times where I was coding and thought things like:
"I could write this a lot more cleanly if I had closures!"
"Some named parameters would be nice here!"
"I sure could sure XML Slurper right now!"
"Why do I have to type 'public' so often?"
"Groovy Truth - how I miss thee greatly!"
Anyways, you get the picture. It's funny -- my first impression of Groovy was that it was TOO powerful. For instance, in Groovy we really do not NEED an external AOP framework (a la AspectJ) because that power is built into the language! Now I'm beginning to see that Groovy's "power" frees me from the little things and allows me to write cleaner and more concise code.

Anywho, those are just my initial impressions after dabbling with Groovy.

Saturday, April 25, 2009

Spring MVC

For my first independent study, I've decided to explore Groovy + Grails. When looking into Grails, I found that much of the web-related functionality is built on Spring MVC. While my primary web framework has been WebWork/Struts 2 over the past couple of years, I thought it might benefit me to look more into Spring MVC as Grails is built on top of it. Also, Spring MVC has been around for a while and seems to have a healthy community behind it.

While reading through their documentation, I found the following interesting statement from Spring's online documentation:

Compared to WebWork, Spring has more differentiated object roles. It supports the notion of a Controller, an optional command or form object, and a model that gets passed to the view. The model will normally include the command or form object but also arbitrary reference data; instead, a WebWork Action combines all those roles into one single object. WebWork does allow you to use existing business objects as part of your form, but only by making them bean properties of the respective Action class. Finally, the same Action instance that handles the request is used for evaluation and form population in the view. Thus, reference data needs to be modeled as bean properties of the Action too. These are (arguably) too many roles for one object.
It always interesting to hear the different philosophies and ideas that went into the development of a web framework and hear how their developers feel about other similar frameworks.

Related Links

Sunday, November 30, 2008

Spring Acquires "Groovy" Company

On November 11, Spring acquired the driving company behind Groovy and Grails. With many people touting Groovy as "next-gen" Java and the Groovy on Grails combination as Java's answer to Ruby on Rails, it will interesting to see what happens now the big boys at Spring have thrown their hat into the ring....

Related Links

Tuesday, November 25, 2008

Java Compentancy Tests

After working at my previous employment for six years, I decided that I wanted a change. I contacted a couple of recruiters and thus began a 2-week adventure that led me to my current position.

Since I was applying for a mid-level position and not a junior position, I had to take a few tests through a separate company that verified that I actually knew a little bit about Java. :-)

Some of the hoops I had to jump through included taking about 6(!) online Java tests. I was quite surprised to find that many of these tests were weighted heavily towards testing one's knowledge of language syntax. For instance, a typical question could be worded like the following example (NOTE: This was *NOT* actually one of the questions, but some of the questions did follow this "style"):

How do I print the word "andrew" to the console?

A. System.out.printline("andrew");
C. System.out.printLine("andrew");
C. System.out.println("andrew");
D. System.out.printLn("andrew");

Is it really that important to test one's knowledge of Java method names? I had to really think about some of the questions as I usually use my IDE's auto-populate features to fill in method names as I need them....

Also, some of the tests already seemed dated. I'm quite familiar with EJB 3.X syntax and semantics, but (thankfully) I missed the EJB 1.X and 2.X days so I struggled my way through many of the archaic EJB questions. Fortunately, EJB 3.X uses some of the same concepts as in EJB 1.X and 2.X so I was able to muddle through some of the questions.

Another annoyance I found was getting quizzed on things like JSP implicit objects when I've spent the past two years avoiding scriptlets in my JSPs! That kind of threw me as I have tried to restrict myself to JSTL & OGNL to retrieve values. By the way, there are 8(!) implicit objects. Off the top of my head I could only think of four of them. :-)

Anywho, I do not fault the test authors for the outdated questions. Java is a constantly changing ecosystem and trying to gauge one's knowledge of the Java platform is like trying to hit a moving target!