Swipe to navigate through the chapters of this book
Spring is an application framework providing dependency injection features for the Java Virtual Machine – features that enable testability, reliability, and flexibility to application developers. It changed how Java is developed, and here’s how and why.
Please log in to get access to this content
Johnson, Rod (2002), Expert One-on-One J2EE Design and Development, Hoboken, NJ: Wiley Press. It’s unfortunately out of print, although you might be able to find it on Amazon and other such sites.
Johnson, Rod & Hoeller, Juergen (2004), Expert One-on-One J2EE Development without EJB, Hoboken, NJ: Wiley Press. Unlike its predecessor, this one’s still in print, although it’s out of date as one can expect from a book published well over a decade ago, as of this book’s publication. I think this footnote is longer than the source paragraph.
For all intents and purposes, J2EE Development without EJB was the more significant book, and an autographed copy lives on one of the author’s shelves in a place of honor. From here on out, any references to these books will center on this latter book.
“J2EE” is a set of specifications and libraries for “enterprise features” in Java. It’s an acronym for “Java 2 Platform, Enterprise Edition,” and was renamed in 2006 to “Java EE.” In 2018, it was turned over to the Eclipse Foundation and renamed “Jakarta EE.”
Lotus 1-2-3 was the first “killer application” for PCs; it was the first truly popular and usable spreadsheet, and revolutionized the PC market all by itself, simply by being respectable and capable. It’s still around somewhere, now owned by IBM, but for most people Microsoft Excel killed it off. I’m going to try to minimize footnotes for a while.
PostgreSQL is an open source relational database engine. See www.postgresql.org/ for more details.
Docker is an open source container for virtualized runtimes; basically, it’s a program that allows you to deploy “application images” for easy deployment. See https://docker.com/ to learn more. So much for my desire to “minimize footnotes.”
JNDI, the “Java Naming and Directory Interface,” is a standard way for an application administrator to create local names for global references. If it sounds sort of like LDAP, it’s because it was derived largely from LDAP. It also meant that in order to look up resources, you had to know how to set up the references, and few bothered. In practice, effectively no one liked doing it as part of development.
TheServerSide Java Symposium, Las Vegas, NV, 2004.
EJB modules were deployed separately from presentation modules, so you had to configure the application to coordinate everything to actually run your code.
Rod Johnson, J2EE Development without EJB (Hoboken: Wiley, 2004), 5-6.
In other words, testability is extremely valuable. Tests allow you to know if the code is working as designed; no more cases where a developer says “I think it should work…” followed by delivery to a customer. That still happens, but it’s not the failure of the technology: it’s a failure of process.
It used to be called “Inversion of Control.”
There is a distinct lack of nuance here. There are actually lots of ways for this to happen; we’ll see many variants and why these variants matter in a later chapter.
Note that we’re going to revisit “Hello, World” in the next chapter, and do it correctly.
Why focus on 2005? Because Spring made J2EE change a lot, something that every Java programmer benefitted from. We’re showing why Spring was such a benefit to Java.
Sadly, the rarity of the best cases was difficult to measure, because most developers would do things inefficiently just so they could avoid the normal deployment model. This is a clear signal that EJB development, while “functional,” didn’t actually work.
Note that the EJB 1.1 source files shown here are not part of the book’s source code. These files are like time-traveling back to when your choices were death by smallpox or death by the bubonic plague.
We’ll see this sort of thing in Chapter 2.
”Java 2, Enterprise Edition” made sense, until you realized that it used Java 1.2. Then you had “Java 2, Enterprise Edition, version 1.3,” and so on. Sun was a brilliant company with confusing release numbering schemes. It made sense when you dug into the details, but it would have made a lot more sense to just use cohesive and sensible version numbers. We’ll talk more about this in Chapter 5 when we discard “J2EE” as a name.
Those old system administrators are probably still on their front porches, shouting “Get off my lawn!”
- History and Justification
Joseph B. Ottinger
- Sequence number
- Chapter number
- Chapter 1