Welcome!

Java IoT Authors: Liz McMillan, Elizabeth White, Pat Romanski, Yeshim Deniz, Frank Lupo

Related Topics: Java IoT, Open Source Cloud, Eclipse

Java IoT: Article

JDJ Cover Story — Agile Java Development with Spring, Hibernate, & Eclipse

A roadmap for building enterprise-class applications using agile methods a POJOs

After getting a head of gray hairs and a quickly receding hairline, I have learned that the simplest solutions are often the best. Having worked with Java since 1995 and various software development lifecycle methodologies over the years, I have seen things grow complex in these areas. Thanks to some new lighter-weight Java tools and agile methods, I can provide a fresh perspective on developing Java applications in an agile manner.

This article is different from typical Java articles for two reasons. First, instead of providing in-depth details on some API or cool tool, it provides a roadmap for building enterprise-class Java applications using agile methods and plain old Java objects (POJOs). Second, it covers a lot of ground, from conceptualization through deployment, so for the sake of brevity, there are minimal code excerpts; however, there's a completely functional sample timesheet application called Time Expression (with source code) built using Spring, Hibernate, Junit, and Ant available at visualpatterns.com/resources.jsp.

We have a lot to cover so let's get started.

Agile Manifesto
In 2001, 17 software experts (including Martin Fowler, Kent Beck, and Jon Kern) got together to discuss lightweight approaches to software development; they jointly defined the term agile. The outcome of this was the "Manifesto for Agile Software Development," a set of values and principles for these agile methods.

The term agile incorporates a wide range of methods; some of them include Extreme Programming (XP), Scrum, Feature Driven Development, Agile Modeling, and Crystal. Many methodologies tend to include both process and modeling since they often go hand-in-hand; we will look at both next. For details on the Agile Manifesto and various agile methods, visit the agilemanifesto.org and agilealliance.org Web sites.

Agile Processes
One of easiest agile processes to understand is Scrum. While XP tends to steal the limelight in the agile community, it's a bit more involved than Scrum. However, the two are highly complementary since XP provides a set of excellent engineering practices whereas Scrum is more about product/project management. In fact, these days I tend to recommend becoming "agile" by bringing in Scrum first, then adding XP practices one at a time, as and when needed since moving entirely to XP-based development (from waterfall) is a rude awakening for many organizations and requires a fundamental mind shift that many projects aren't ready for.

So, how does Scrum work? Simple. We gather a list of new features or change requests for an application in a product backlog. For our sample application, Time Expression, these could include:

  • Hourly employees will be able to sign in to a Web application and enter their hours for each day of a given week.
  • The employee's manager must approve the timesheet.
  • After a timesheet is approved or disapproved, notification is sent to the employee indicating the updated status of the timesheet.
  • And so on...
From here, we simply take the highest-priority features, move them to a sprint backlog, and implement them in one-month (or shorter) iterations called sprints, and continue having monthly sprints till all the features are implemented. Each sprint (or iteration) contains the entire software lifecycle, in other words, detailed requirements/analysis, design, coding, unit/acceptance testing, and deployment of production-ready code. Scrum also suggests having a planning meeting at the beginning of a sprint and a review at the end of the sprint to discuss lessons learned or the next set of features to implement in the following sprint. Other than that, we have a short daily meeting (say, 15 minutes) to discuss the project's status. Figure 1 depicts the Scrum process. Visit controlchaos.com for details on Scrum.

A common theme of agile processes is iterative development. For example, XP works like Scrum, however, it uses the concept of quarterly releases with weekly iterations as shown in Figure 2. Also the features are provided in the form of user stories, typically written by the customer using one to three lines to describe the feature. My explanation of XP is overly simplified; there's a lot more to it such as pair programming, sit together, and continuous build. Visit extremeprogramming.org for details on XP.

So now we've looked at two agile processes, Scrum and XP. These help in gathering user feature requests and overall project management. However, as developers, we need to implement features by engineering them into software applications, so let's look at agile modeling techniques next, which can help us bridge the gap between user requirements and coding.

Agile Design
According to thefreedictionary.com, a model is "a preliminary work or construction that serves as a plan from which a final product is to be made...used in testing or perfecting a final product." So here I'll use the word "model" to describe diagrams and other artifacts.

Agile Model-Driven Development
Agile Model-Driven Development (AMDD) created by Scott Ambler provides guidelines for effective modeling. Instead of creating extensive models, AMDD recommends creating "good enough" models. One of my favorite Scott quotes is "your goal is to build a shared understanding, it isn't to write detailed documentation."

AMDD suggests two categories of models, requirements and architecture. Requirements models could include a domain model (Figure 3), usage models such as user stories or use cases (Figure 4), and UI models such as prototypes and flow map (Figure 5 and Figure 6).

Architecture models could include a freeform model like the one shown in Figure 7.

There really isn't a whole lot more to AMDD since it provides minimal guidelines for agile modeling. Visit agilemodeling.com for more details.

Agile Draw
Before moving to the next topic, let me briefly mention a new and elegantly simple technique called Agile Draw, which was used to draw Figures 3-7. This technique provides an alternative to the heavy-handed Unified Modeling Language (UML) but can also be used to complement UML. Agile Draw provides minimum guidelines for modeling and additional guidelines for adding appeal to these models using graphic design concepts. The core concepts behind Agile Draw include four basic components that make it a virtually notation-free modeling technique; these concepts include circles, boxes, lines, and text. Using them you can draw practically any model by hand or with a drawing program.

Visit agiledraw.org for more details.

Refactoring
One of the core aspects of agile methods is not to do too much design upfront so you can start showing results to the customer quickly by developing actual software versus producing comprehensive documentation that no one actually reads or maintains. Of course, the downside is that it cuts down on the amount of design done for an application. However, this isn't necessarily a bad thing since most programmers find better ways of doing things once they begin coding.

For example, we find cleaner ways of structuring our code after the first pass at it, perhaps by improving our own design or because we learned a better way of using a framework (such as Hibernate or Spring). This code improvement is known as refactoring and is considered a continuous design activity.

Refactoring is more than fluff; it's now appearing as a menu option in integrated development environments such as Eclipse and IntelliJ IDEA. Visit Martin Fowler's Web site, refactoring.com, for more information on refactoring along with a catalog of many refactoring techniques.

Other Design Considerations
While refactoring can help improve code, there might be other things you should consider upfront or in the first couple of iterations. Some of these include schemes for transaction management, exception handling, clustering, and application security (authentication, authorization, and encryption). Any enterprise-class project that doesn't at least consider these "big picture factors" upfront is asking for trouble later. One common problem found in XP projects is that a lot left for refactoring later never happens. Drawing bare-minimum architecture models like the one shown in Figure 7 upfront can help with general discussions about the important design considerations I've mentioned here.


More Stories By Anil Hemrajani

Anil Hemrajani is the author of the book titled Agile Java Development with Spring, Hibernate and Eclipse. He is the founder of Isavix Corporation (now InScope Solutions, Inc.), a successful IT services company, and DeveloperHub.com (formerly isavix.net), an award-winning online developer community that grew to over 100,000 registered members. He has twenty years of experience in the Information Technology community working with several Fortune 100 companies and also smaller organizations. He has published numerous articles in well known trade journals, presented around the world, and received and/or nominated for several awards. Anil can be reached via his web site, VisualPatterns.com.

Comments (3) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
JDJAgile 07/27/06 07:33:07 AM EDT

Hey Jeff, JDJ used all of the lastest Agile methods to develop their pages, so you see it's fast, it's now, it works! Far be it from me to stand in the way of progress. Give me a break, none of this crap has infiltrated coporate computing in the least. Just go back and code like the rest of us and stop patting each other on the back for your supposed genius.

I'm sure the author is well-meaning but when we're bombarded daily with titles like "The Four Quantum States of Ajax" I just gotta laugh. Do you really think all this stuff is changing anything?!

The engineering world wants real engineering not something built on top of existing frameworks decades old that works and works well.

Jeff 07/25/06 10:48:49 PM EDT

Holy crud, the pop up ad blocks the entire story even at 1360 x 768. Do you really need an Ad that big that requires a click to close? There are already adds on both margins and the in the header and Footer, the content is a thin ribbon down the center that get blocked by yet another ad. Just seems silly to me.

@ThingsExpo Stories
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, will lead you through the exciting evolution of the cloud. He'll look at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering ...
SYS-CON Events announced today that N3N will exhibit at SYS-CON's @ThingsExpo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. N3N’s solutions increase the effectiveness of operations and control centers, increase the value of IoT investments, and facilitate real-time operational decision making. N3N enables operations teams with a four dimensional digital “big board” that consolidates real-time live video feeds alongside IoT sensor data a...
In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It’s clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Tha...
SYS-CON Events announced today that Avere Systems, a leading provider of enterprise storage for the hybrid cloud, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere delivers a more modern architectural approach to storage that doesn't require the overprovisioning of storage capacity to achieve performance, overspending on expensive storage media for inactive data or the overbui...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
SYS-CON Events announced today that mruby Forum will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. mruby is the lightweight implementation of the Ruby language. We introduce mruby and the mruby IoT framework that enhances development productivity. For more information, visit http://forum.mruby.org/.
Digital transformation is changing the face of business. The IDC predicts that enterprises will commit to a massive new scale of digital transformation, to stake out leadership positions in the "digital transformation economy." Accordingly, attendees at the upcoming Cloud Expo | @ThingsExpo at the Santa Clara Convention Center in Santa Clara, CA, Oct 31-Nov 2, will find fresh new content in a new track called Enterprise Cloud & Digital Transformation.
SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp emp...
Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
Amazon is pursuing new markets and disrupting industries at an incredible pace. Almost every industry seems to be in its crosshairs. Companies and industries that once thought they were safe are now worried about being “Amazoned.”. The new watch word should be “Be afraid. Be very afraid.” In his session 21st Cloud Expo, Chris Kocher, a co-founder of Grey Heron, will address questions such as: What new areas is Amazon disrupting? How are they doing this? Where are they likely to go? What are th...
Most technology leaders, contemporary and from the hardware era, are reshaping their businesses to do software. They hope to capture value from emerging technologies such as IoT, SDN, and AI. Ultimately, irrespective of the vertical, it is about deriving value from independent software applications participating in an ecosystem as one comprehensive solution. In his session at @ThingsExpo, Kausik Sridhar, founder and CTO of Pulzze Systems, will discuss how given the magnitude of today's applicati...
Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant th...
SYS-CON Events announced today that SkyScale will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. SkyScale is a world-class provider of cloud-based, ultra-fast multi-GPU hardware platforms for lease to customers desiring the fastest performance available as a service anywhere in the world. SkyScale builds, configures, and manages dedicated systems strategically located in maximum-security...
SYS-CON Events announced today that Avere Systems, a leading provider of hybrid cloud enablement solutions, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere Systems was created by file systems experts determined to reinvent storage by changing the way enterprises thought about and bought storage resources. With decades of experience behind the company’s founders, Avere got its ...
SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. ANSeeN are the measurement electronics maker for X-ray and Gamma-ray and Neutron measurement equipment such as spectrometers, pulse shape analyzer, and CdTe-FPD. For more information, visit http://anseen.com/.
High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, will discuss how by using...
In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...
SYS-CON Events announced today that Yuasa System will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Yuasa System is introducing a multi-purpose endurance testing system for flexible displays, OLED devices, flexible substrates, flat cables, and films in smartphones, wearables, automobiles, and healthcare.
SYS-CON Events announced today that CAST Software will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CAST was founded more than 25 years ago to make the invisible visible. Built around the idea that even the best analytics on the market still leave blind spots for technical teams looking to deliver better software and prevent outages, CAST provides the software intelligence that matter ...
SYS-CON Events announced today that Daiya Industry will exhibit at the Japanese Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ruby Development Inc. builds new services in short period of time and provides a continuous support of those services based on Ruby on Rails. For more information, please visit https://github.com/RubyDevInc.