Chapter 1. Introduction
Background
In early 2004, Martin Fowler asked the readers of his site: when talking about Inversion of Control: “the
question is, what aspect of control are [they] inverting?”. Fowler then suggested renaming the principle
(or at least giving it a more self-explanatory name), and started to use the term Dependency Injection. His
article then continued to explain the ideas underpinning the Inversion of Control (IoC) and Dependency
Injection (DI) principle.
If you need a decent insight into IoC and DI, please do refer to said article :
http://martinfowler.com/articles/injection.html.
Java applications (a loose term which runs the gamut from constrained applets to full-fledged n-tier server-side
enterprise applications) typically are composed of a number of objects that collaborate with one another to form
the application proper. The objects in an application can thus be said to have dependencies between themselves.
The Java language and platform provides a wealth of functionality for architecting and building applications,
ranging all the way from the very basic building blocks of primitive types and classes (and the means to define
new classes), to rich full-featured application servers and web frameworks. One area that is decidedly
conspicuous by its absence is any means of taking the basic building blocks and composing them into a
coherent whole; this area has typically been left to the purvey of the architects and developers tasked with
building an application (or applications). Now to be fair, there are a number of design patterns devoted to the
business of composing the various classes and object instances that makeup an all-singing, all-dancing
application. Design patterns such as Factory, Abstract Factory, Builder, Decorator, and Service Locator (to
name but a few) have widespread recognition and acceptance within the software development industry
(presumably that is why these patterns have been formalized as patterns in the first place). This is all very well,
but these patterns are just that: best practices given a name, typically together with a description of what the
pattern does, where the pattern is typically best applied, the problems that the application of the pattern
addresses, and so forth. Notice that the last paragraph used the phrase “... a description of what the pattern
does...”; pattern books and wikis are typically listings of such formalized best practice that you can certainly
take away, mull over, and then implement yourself in your application.
The IoC component of the Spring Framework addresses the enterprise concern of taking the classes, objects,
and services that are to compose an application, by providing a formalized means of composing these various
disparate components into a fully working application ready for use. The Spring Framework takes best
practices that have been proven over the years in numerous applications and formalized as design patterns, and
actually codifies these patterns as first class objects that you as an architect and developer can take away and
integrate into your own application(s). This is a Very Good Thing Indeed as attested to by the numerous
organizations and institutions that have used the Spring Framework to engineer robust, maintainable
applications.
分享到:
相关推荐
Chapter 1. Introduction to Computers and Electronics Chapter 2. Introduction to Embedded Systems Chapter 3. Introduction to the ARM?Cortex?-M Processor Chapter 4. Introduction to Input/Output Chapter ...
Chapter 1. Introduction to MVC Chapter 2. Introduction to Bootstrap Chapter 3. Introduction to Knockout.js Chapter 4. Working with a Database Part II. Working with Data Chapter 5. Listing, Sorting, ...
Introduction.pdf”和“RFAmplifierDesign”,这表明文件是关于射频放大器设计的入门介绍。内容中提到的“中華大學電機系田慶誠副教授”可能是指该教材的作者或主要讲解者,而“***”是作者的电子邮件地址。 在...
Chapter 1. Introduction Chapter 2. Discrete-Time Signals Chapter 3. Discrete-Time Random Signals Chapter 4. Statistical Tests and High Order Moments Chapter 5. Discrete Fourier Transform of Discrete-...
Introduction and Definitions of Software Best Practices 1 Chapter 2. Overview of 50 Software Best Practices 39 Chapter 3. A Preview of Software Development and Maintenance in 2049 177 Chapter 4. How ...
Introduction. Chapter 2. Fading Channel Characterization and Modeling. Chapter 3. Types of Communication. PART 2: MATHEMATICAL TOOLS. Chapter 4. Alternative Representations of Classical Functions. ...
Chapter 1.Introduction Chapter 2.XML 1.1 and SAX 2.0.2 Chapter 3.DOM Level 3 Chapter 4.XPath 1.0(and 2.0) and XSLT 1.0(and 2.0) Chapter 5.XPath 1.0and 2.0) and XSLT 1.0(and 2.0),Continued Chapter 6....
Chapter 1. Introduction Section 1.1. Introduction Section 1.2. A Simple Daytime Client Section 1.3. Protocol Independence Section 1.4. Error Handling: Wrapper Functions Section 1.5. A ...
Chapter 1. Introduction Chapter 2. Concurrency on the JVM and the Java Memory Model Chapter 3. Traditional Building Blocks of Concurrency Chapter 4. Asynchronous Programming with Futures and Promises ...
Chapter 1. Introduction to OOP Chapter 2. Getting Started With Java Chapter 3. Java Programming Constructs Chapter 4. Classes and Objects Chapter 5. Inheritance Chapter 6. Interfaces, Packages, and ...
Chapter 1. Introduction, Section 1.1. The High Performance Buzz-word, Chapter 2. The Theory of Computation, Section 2.1. Introduction, Section 2.2. Problems, Section 2.3. Models of Computation, ...