The Wayback Machine - https://web.archive.org/web/20180204110204/http://java.sys-con.com/node/47735

Welcome!

Java IoT Authors: Elizabeth White, Yeshim Deniz, Ed Featherston, Stackify Blog, Pat Romanski

Related Topics: Java IoT, Linux Containers, SYS-CON MEDIA, IT SOLUTIONS GUIDE

Java IoT: Article

i-Technology Viewpoint: "Spring Good!"

Rick Hightower Gives New Year's Thumbs-Up To Java/J2EE Application Framework

If you have not looked into Spring yet, it is time. Here is why you should!

Grady Booch once said that the great thing about objects is that they can be replaced. The great thing about Spring is it helps you replace them. With Spring, you simply inject collaborating objects called dependencies using JavaBeans properties and configuration files. Then it's easy enough to switch out collaborating objects when you need to. Spring allows you to dynamically add services to objects called aspects. This is similar to the Decorator Design pattern, but does not require you to recompile your code base to apply these services. This allows you to replace objects with objects that enhance the originals.

The ability to inject collaborating objects is often called IoC (inversion of control). Thus, Spring is an IoC container. If you follow the latest developer buzz then you've likely heard of IoC (Inversion of Control) containers and AOP (aspect-oriented programming). Like many developers, however, you may not see where these technologies fit into your development efforts. As the word inversion implies, IoC is like JNDI turned inside out. Instead of using a tangle of abstract factories, service locators, singletons, and straight construction, each object is constructed with its collaborating objects. Thus, the container manages the collaborators. (Collaborators are objects that an object needs to fullfill its role.)

The ability to dynamically add services to objects is called AOP. AOP allows developers to create non-domain concerns, called crosscutting concerns, and insert them in their application code. With AOP, common services like logging, persistence, transactions, and the like can be factored into aspects and applied to domain objects without complicating the object model of the domain objects.

Thus, Spring is an IoC/AOP container. There are many IoC containers. There are also many AOP frameworks. If Spring was only an IoC/AOP container, it would be worth your attention and interest since it seems to be the most mature. Spring is a lot more than an IoC/AOP container.

What makes Spring different than the other frameworks and containers, is Spring goes beyond just being an IoC container or an AOP framework. The other containers are academic interests, and some are quite good. They provide good support of IoC and AOP.

Spring goes one step further by eating its own dog food. It uses IoC and AOP to provide a comprehensive library for simplifying J2EE development. This comprehensive library is written with aspects, dependency injection and OOP best practices.

Spring makes J2EE development easier. It does this with a variety of mechanisms. One common mechanism is its use of templates. A template is a cross between a utility class and execution environment. Spring Templates are an embellishment and extention of the Template design pattern (GOF).

At first glance templates appear to be well written utility classes. However, templates provide a lot more than just utility functions. Templates provide and execution environment. When using a template you first endeavor to use one of its it utility method. If the template doesn't have a utility method you need, you implement a callback object. The callback object has a method that executes a method in the environment of the template. The template therefore takes care of things like exception handling and resource management in a consistent manner. This means your code base will not be littered with try/catch/finally blocks, and it is easier to ensure that resources and exception are handled correctly.

Spring promotes good programming practices. It does this by providing great examples how to use IoC and AOP in a consistent manner. It also does this by showing how to build things like templates to manage resources and exceptions in the consistent manner. It goes even further by building sets of frameworks on top of  IoC, AOP and templates that are the embodiment of good OO programming.

The IoC capabilities allowing injection of dependent objects turns out to be a great mechanism for testing your code. It is easy now to inject mock objects (object for testing), and test your classes in an isolated manner. For example, you can test you business delegates without relying on the DAO (Data access objects) objects talking to the database. Essentially Spring took back development from the design pattern hacks deemed necessary to program J2EE. As Rod Johnson once put it: Spring puts the OO back in J2EE development.

Spring provides portability through abstraction of common services. For example, Spring provides a common interface object relational management (ORM) systems like Hibernate, JDO, Cayenne, Spring JDBC and iBatis. It provides a mechanism for building DAO objects that divorces the client code from the underlying implementation. it does this by providing a common set of exceptions like object not found exception, and making these exception runtime exceptions.

Spring provides a easy on-ramp for many industry-standard projects. And not just industry-standard projects but the de facto industry-standard projects. The projects that people actually use to get their daily work done. For example, Spring provides support for JDO, Hibernate, Quartz, Tapestry, JavaServer faces, and many more frameworks. Its been said that Spring simplifies J2EE development, and that is a primary focus of Spring. However,Spring provides utilities to work with all tiers of an n-tier application. For an MVC application, there are utilities for working with View technologies (Struts, Spring, Rich Client etc.), Model (EJB, AOP based transaction, AOP based security, etc.), etc. You can use Spring to build Swing and SWT applications.

If you have not looked into Spring yet, it is time.

------------------------------------------------
The above started as a reply to Cameron Purdy's prediction list, which I really liked. Then I got carried away and it became a full blown plug for Spring. (Darn Caffiene!)

What is Spring?

Spring is a popular AOP/IoC framework that was developed by Rod Johnson, Juergen Hoeller et al. Spring simplifies J2EE and Java development. Rod Johnson is the famed author who wrote Expert One-on-One J2EE Design and Development.

Spring makes J2EE development easier. Spring is a J2EE framework that simplifies commons tasks and encourages good design based on programming to interfaces. Springs makes your application easier to configure and reduces the need for many J2EE design patterns (quite a few J2EE design patterns are really glorified hacks that clutter your code base). Spring puts the OO design back into your J2EE application.

More Stories By Rick Hightower

Rick Hightower serves as chief technology officer for ArcMind Inc. He is coauthor of the popular book Java Tools for Extreme Programming, which covers applying XP to J2EE development, and also recently co-authored Professional Struts. He has been working with J2EE since the very early days and lately has been working mostly with Maven, Spring, JSF and Hibernate. Rick is a big JSF and Spring fan. Rick has taught several workshops and training courses involving the Spring framework as well as worked on several projects consulting, mentoring and developing with the Spring framework. He blogs at http://jroller.com/page/RickHigh.

Comments (4) 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
Rick Hightower 01/08/05 06:26:10 PM EST

The article (like the last one I wrote) started out as being a blog entry (http://jroller.com/page/RickHigh/20050107#spring_plug).

It is nice when the JDJ picks it up and gives it more exposure. The last blog entry turned article I wrote was read quite a bit according to the JDJ folks.

I've written some follow up ideas at:

http://www.arc-mind.com/papers/springIsGood.html

Rick Hightower 01/08/05 05:53:57 PM EST

I've used Spring on a half dozen different projects now (most if not all of them in production).

The first time I used Spring I was amazed how much it helped to simplify the code base.

Once you get rid of all of the service locators, and dynamic creation of implementations, and singletons, etc. then the code base gets a bit smaller.

Also using the Spring templates really helps to keep things simple and yet manage resources well.

I much prefer using Hibernate with Spring then without it. It really simplifies things.

Agreed 01/08/05 05:20:08 AM EST

Spring manages your mappings and helps maintain consistency across your data connections and helps you abstract your business logic, keeping it out of the actual pages. Best of all it also integrates with Struts.

Spring has sprung 01/08/05 05:04:16 AM EST

Wasn't it Purdy who said it's imposible to resist saying the word Spring. ("Yup, it's like trying not to think of pink elephants - impossible once you get that in your head. Spring, spring, spring, spring. La tee dah, spring spring spring.")

What's in a name?

@ThingsExpo Stories
DX World EXPO, LLC, a Lighthouse Point, Florida-based startup trade show producer and the creator of "DXWorldEXPO® - Digital Transformation Conference & Expo" has announced its executive management team. The team is headed by Levent Selamoglu, who has been named CEO. "Now is the time for a truly global DX event, to bring together the leading minds from the technology world in a conversation about Digital Transformation," he said in making the announcement.
Digital Transformation (DX) is not a "one-size-fits all" strategy. Each organization needs to develop its own unique, long-term DX plan. It must do so by realizing that we now live in a data-driven age, and that technologies such as Cloud Computing, Big Data, the IoT, Cognitive Computing, and Blockchain are only tools. In her general session at 21st Cloud Expo, Rebecca Wanta explained how the strategy must focus on DX and include a commitment from top management to create great IT jobs, monitor ...
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
The IoT Will Grow: In what might be the most obvious prediction of the decade, the IoT will continue to expand next year, with more and more devices coming online every single day. What isn’t so obvious about this prediction: where that growth will occur. The retail, healthcare, and industrial/supply chain industries will likely see the greatest growth. Forrester Research has predicted the IoT will become “the backbone” of customer value as it continues to grow. It is no surprise that retail is ...
"Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that Conference Guru has been named “Media Sponsor” of the 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. A valuable conference experience generates new contacts, sales leads, potential strategic partners and potential investors; helps gather competitive intelligence and even provides inspiration for new products and services. Conference Guru works with conference organizers to pass great deals to gre...
The Internet of Things will challenge the status quo of how IT and development organizations operate. Or will it? Certainly the fog layer of IoT requires special insights about data ontology, security and transactional integrity. But the developmental challenges are the same: People, Process and Platform. In his session at @ThingsExpo, Craig Sproule, CEO of Metavine, demonstrated how to move beyond today's coding paradigm and shared the must-have mindsets for removing complexity from the develop...
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked 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 m...
"Evatronix provides design services to companies that need to integrate the IoT technology in their products but they don't necessarily have the expertise, knowledge and design team to do so," explained Adam Morawiec, VP of Business Development at Evatronix, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
Large industrial manufacturing organizations are adopting the agile principles of cloud software companies. The industrial manufacturing development process has not scaled over time. Now that design CAD teams are geographically distributed, centralizing their work is key. With large multi-gigabyte projects, outdated tools have stifled industrial team agility, time-to-market milestones, and impacted P&L; stakeholders.
"Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
"There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.