- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
Introducing the Spring framework in Java
16.1 Introducing the Spring framework Generate Data Matrix 2d Barcode In Java Using Barcode creator for Java Control to generate, create Data Matrix image in Java applications. www.OnBarcode.comDecode DataMatrix In Java Using Barcode reader for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.comSimply put, Spring is an inversion of control (IoC) and AOP framework. While it is also a container, it is widely popular for its framework benefits. The Spring framework built on many of the lessons learned from the other projects, either directly or indirectly, by understanding the importance of certain principles now known as IoC and separation of concerns (SoC). The primary goal for the Spring framework is to simplify development of enterprise Java applications. In this section we ll briefly introduce the Spring framework and then explore the IoC principle behind it. Create Universal Product Code Version A In Java Using Barcode maker for Java Control to generate, create UCC - 12 image in Java applications. www.OnBarcode.comQuick Response Code Creation In Java Using Barcode generator for Java Control to generate, create QR Code JIS X 0510 image in Java applications. www.OnBarcode.comIntroducing the Spring framework
GS1 - 13 Creator In Java Using Barcode generator for Java Control to generate, create EAN-13 Supplement 5 image in Java applications. www.OnBarcode.comGS1 RSS Creation In Java Using Barcode generator for Java Control to generate, create GS1 DataBar Limited image in Java applications. www.OnBarcode.com16.1.1 Benefits of the Spring framework
Code 3/9 Encoder In Java Using Barcode creation for Java Control to generate, create Code 39 Extended image in Java applications. www.OnBarcode.comEncoding British Royal Mail 4-State Customer Code In Java Using Barcode creation for Java Control to generate, create RoyalMail4SCC image in Java applications. www.OnBarcode.comSpring is one of the driving forces behind popularizing the POJO programming model and dependency injection. Enterprise application development with J2EE 1.4 and EJB 2 was very complex, and Spring gained popularity because it addressed many complexities and limitations of J2EE 1.4 and EJB 2. It provided a simple programming model for using resources such as JDBC or JMS or using popular persistence frameworks like Hibernate or TopLink by abstracting low-level API and configuration from developers without limiting developers choices. Many developers want to choose a persistence, web, or messaging framework without having to do the integration work. The developers of the Spring framework realized that no matter which persistence, web, messaging, or whatever framework they selected to support, someone would want to use something else, and a better alternative would eventually come along. Also, this type of integration is typically expensive. By following the IoC and SoC principles, Spring was able to be both lightweight enough to let developers decide how much of the framework they needed, and flexible enough to support many permutations of competing component frameworks. Spring provides several modules, such as the following: Drawing Data Matrix 2d Barcode In Java Using Barcode drawer for Android Control to generate, create ECC200 image in Android applications. www.OnBarcode.comDataMatrix Maker In .NET Framework Using Barcode maker for ASP.NET Control to generate, create Data Matrix 2d barcode image in ASP.NET applications. www.OnBarcode.comAOP module JDBC abstraction and DAO module ORM integration module
Drawing Barcode In VB.NET Using Barcode generator for VS .NET Control to generate, create Barcode image in Visual Studio .NET applications. www.OnBarcode.comBarcode Generation In Java Using Barcode encoder for BIRT Control to generate, create Barcode image in Eclipse BIRT applications. www.OnBarcode.comWeb module
Print Barcode In None Using Barcode printer for Excel Control to generate, create Barcode image in Excel applications. www.OnBarcode.comMake Barcode In Visual Studio .NET Using Barcode creator for Reporting Service Control to generate, create Barcode image in Reporting Service applications. www.OnBarcode.comMVC framework
Matrix Barcode Creation In Visual Studio .NET Using Barcode printer for VS .NET Control to generate, create Matrix image in .NET framework applications. www.OnBarcode.comDrawing Barcode In None Using Barcode generation for Font Control to generate, create Barcode image in Font applications. www.OnBarcode.comAlthough the Spring framework supports almost as many features as a Java EE container, it is not positioned as an alternative to Java EE but as a framework that facilitates the development of applications with Java EE. That s one of the primary reasons for Spring being successful as a framework. You can use the Spring framework on its own or inside a Java EE container. Most application servers, such as Oracle and WebLogic, provide additional support to use Spring. Now let s turn our focus to the IoC principle driving the Spring framework. Data Matrix 2d Barcode Decoder In Java Using Barcode decoder for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.comCode39 Creation In Visual Studio .NET Using Barcode encoder for Visual Studio .NET Control to generate, create Code 39 Full ASCII image in VS .NET applications. www.OnBarcode.com16.1.2 The inversion of control principle
Generating UPC-A In Visual Studio .NET Using Barcode generation for ASP.NET Control to generate, create UPC A image in ASP.NET applications. www.OnBarcode.comDrawing QR Code In None Using Barcode generator for Online Control to generate, create QR Code ISO/IEC18004 image in Online applications. www.OnBarcode.comSometimes explained as the Don t Call Us, We ll Call You principle. It s the idea that a component or service should do one thing, and do it well, and not have to know too much if anything about the other matters in the context of doing its job. EJB 3 and Spring
Let s say you have a ThingAmaJig component that needs a WhatchaMaCallIt and a DooHickey in order to do its job. Now the ThingAmaJig can try to find the other two components when it s invoked or it could expect its caller to provide them. This second approach is the IoC principle. Humans instinctively use IoC all the time and are not even aware of it. If you are at a client location and someone walks up to you and tells you that you have a call waiting from your coworker, they also hand you the phone that is already connected to your office, or tell you where the phone is. They don t expect you to just know where your coworker was calling from, nor do they expect you to figure it out. They provide the needed information for you to complete the conversation. The same is true for someone invited to speak at a conference. The speaker isn t expected to provide the conference room, audience, refreshments, and so forth. Those are provided by someone else. However, these other components are critical to the speaker being able to perform the requested tasks especially consuming the refreshments! An article by Martin Fowler (www.martinfowler.com/articles/injection.html) proposed that while the IoC principle was good, its name could use a slight adjustment. He proposed dependency injection as a name that more accurately described what IoC did. It appears that most of the industry has agreed, and this is why you will see DI referenced more than IoC in newer literature, especially EJB 3 documentation.
|
|