Agile Java Development - Runtime Technologies
-
font size
decrease font size
increase font size
Runtime Technologies
This section provides a brief description of the runtime technologies. Runtime technologies are used to run the application after it is deployed, versus development tools, which are used to develop the application. Figure 1.1 provides a visual representation of how these technologies fit together to provide a complete runtime solution.
The Spring Framework contains a large number of classes and packages, but it is designed as a modular framework that can be phased gradually into a project by using only the features needed (for example, web framework). Spring complements Java/JEE by providing an Inversion of Control (IoC) container (explained later in book), a web framework, a transaction management abstraction layer, JDBC helper classes, job scheduling APIs, email capabilities, and more. Spring has been around since 2002 and has gained considerable momentum and support from the community, including commercial vendors such as BEA Systems.
As of the writing of this book, Spring was a frontrunner in the IoC container space; however, its web framework is surprisingly popular, as well. I chose Spring for the web framework because I also needed many of its other features, such as IoC, transaction management, email, scheduling, and more.
Hibernate is an object-to-relational (OR) mapping persistence framework for Java. Hibernate can arguably be credited with bringing OR technology to the forefront for average Java developers and not just specialized OR experts. Hibernate is perhaps the most widely used OR framework currently in the world of Java developers. Hibernate also serves as a good alternative to Entity Beans, which is perhaps one of the reasons EJB 3 has adopted many techniques from Hibernate (and JDO and Toplink). Given these reasons, my decision to go with Hibernate was easier than selecting a web framework.
HSQLDB is a lightweight but complete relational database management system (RDBMS) written in 100% Java. It supports a subset of the ANSI-92 SQL standard and has a JDBC driver to interface with the database via Java programs. The popularity of HSQLDB has grown steadily over the past few years.
Tomcat is perhaps the most popular Java-based web server and servlet container. It is a relatively lightweight servlet container that has grown in popularity over the past few years. I chose this product because many developers are already familiar with it, so it seemed like the obvious choice. Similar to HSQLDB, which can be replaced with a more robust database (such as MySQL or Oracle), Tomcat can also be replaced with a more robust web and/or application server, such as BEA's WebLogic.
The following are the development tools we will use to construct our sample application.
Eclipse is one of the best things to have happened to Java in recent years. In my opinion, it has given Java a longer life as a dominant technology. In fact, Chapter 8, "The Eclipse Phenomenon!," is dedicated to Eclipse and is loaded with information about the core IDE and the enormous number of plug-ins available for it.
Anyone working with Java these days has almost certainly heard of or worked with Ant. Ant is the most common way to build (and deploy) Java programs today. Although Ant is similar to the Unix make utility, it provides several benefits over the make utility.
<?xml version="1.0"?>
<project name="HelloTest" default="printmessage">
<target name="printmessage">
<echo message="Hello world!"/>
</target>
</project>
JUnit is the de facto unit-testing framework used by Java developers today. I wasn't always a fan of writing unit tests first, but recently I have come to appreciate unit tests and the notion of tests first. I'll explain later in this book how to write effective unit tests. Figure 1.5 provides a screenshot of the JUnit GUI tool to give you an idea of how you can unit test your code. However, by the time we are done with Chapter 8, you will appreciate how tightly integrated JUnit is with the Eclipse SDK.
You might be wondering why a web browser is explicitly listed here. Trust me, it isn't about a browser religion thing. Simply put, Firefox has a lot of features that help in web application development,. What is fascinating about Firefox is the large number of useful plug-ins available for it. At the time of this writing, the https://addons.mozilla.org/ website (also accessible from the Tools, Extensions menu) had 1,091 plug-ins!
OpenOffice.org is an open source suite of office productivity tools that competes directly with Microsoft Office. At first, I wasn't sure if listing OpenOffice.org explicitly in Table 1.1 was needed, because it isn't a core technology I'm writing about in this chapter. Also, I had checked out OpenOffice.org a couple of years ago when it was still a maturing product, and I wasn't that impressed with it. OpenOffice.org has come a long way and is equivalent to Microsoft Office in almost every respect. In fact, OpenOffice.org can also read and write natively to Microsoft Office files, seamlessly.
Software Development Methodology Used in This Book
To make a project successful, I have always believed that active stakeholder involvement, simplicity (design, tools, documentation), common sense, and a basic/minimal software development process does the trick. Furthermore, I do not like to reinvent the wheel, so if someone out there has assembled a good solution that I can use, I will. One such solution I have used in the recent past is the combination of best practices and techniques recommended by the Agile Model Driven Development (http://agilemodeling.com) and Extreme Programming (http://extremeprogramming.org), or for short, AMDD and XP, respectively.
Prior to the working with AMDD and XP, I was using the Rational Unified Process (RUP) for projects. However, I find RUP a bit heavier on the artifact side. I like the combination of AMDD and XP because both methods are nimble and complement each other; XP focuses on the full life cycle and AMDD focuses on modeling (user-interface model, for example). You will learn more about these two methodologies in the next chapter along with my opinion about why I like Agile Modeling's values, principles, and practices.