Home Tutorialhelp Comment Dependency / IoC via Spring.

 
 

Comment

Anup Jani
Dependency / IoC via Spring.,
November 15, 2008 at 6:29 PM

Good question. In simple words:
If you want to use any framework (e.g. Struts, Hibernate, etc...) within your application, your code has to use the API provided by that framework. This makes your code that framework dependent. Spring minimizes this by rather injecting such dependencies into your application (As you go on declaring various configurations in XML files). Hence your application code is much cleaner.

That's why Rod Johnson et al. say: "Application code written as part of a Spring application can be run without Spring or any other container", yet it's not 100% freedom. E.g. for writing Spring MVC, your handler/controller has to extend one of the controllers (AbstractController) & implement "handleRequestInternal()" method that returns ModelAndView object. That's the reason why they also say: "Lock-in to Spring is <b>minimized</b>".

Thus, not only Spring code, but also any code (preferably AOP, Transaction, Security related) can be injected. This makes your application code look cleaner. (but at the same time highly configured in the background).

However, in my opinion, every new framework/technology has proclaimed to have offered to allow developer focus on business logic but only forthcoming time will reveal the truth. Because just like how people used to dream of paperless office during computer era which ironically has proven a myth as the paper usage has increased dramatically causing more & more trees chopped.

So let's wait & watch whether this Frameworks proliferation end up in making a developers' life more miserable or let them focus on business logic.

Anup Jani.
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Spring 3

Spring IoC, Spring 3 IoC Container Tutorial and example code.
of the Spring Framework provides Dependency Injection and Inversion of Control (IOC... in runtime by the Spring Framework. The IoC is also known as Dependency...Spring IoC In this section we will learn Spring IoC with the help of many 

Spring Framework Questions

What is Spring IOC Container ?
What is Spring IOC Container ?  Hi, What is Spring IOC Container ? Thanks 

IoC Questions

Spring - IoC
 

Spring Framework

Spring Dependency-Check
Spring Dependency-Check In this tutorial you will see how to check for unresolved dependencies of a bean that is deployed into the spring IoC container... are satisfied or not. The dependency-check attribute is set in the <bean/> 

Maven Questions

spring modelandview maven dependency
spring modelandview maven dependency  Hi, how to add the spring modelandview maven dependency in pom.xml file. In my application its saying that ModelAndView class not found. Thanks   You should add the spring-webmvc 

IoC Questions

spring
spring   hi how can we make spring bean as prototype how can we load applicationcontext in spring what is dependency injection 

Spring Framework

Spring asm Dependency
Spring 3 ASM - Spring asm Dependency       In earlier version of Spring... dependency in your Spring 3 project you might get the following error: Jan 

Free Magazine

Spring-IoC Features
Spring-IoC Features          Spring Framework The Spring Framework comes in the form of ZIP file with the necessary jars, examples etc. The Spring framework can 

Spring Framework Questions

Questions on Spring - Spring
is the AOP framework. While the Spring IoC container does not depend on AOP, meaning you don't need to use AOP if you don't want to, AOP complements Spring IoC...Questions on Spring  1> what is Spring Framework ? why does 

Spring Framework Questions

Spring
Spring  I understand spring as dependency injection. It can avoid object creating and can directly inject values. But i am comfusing that Dependency... comfusing that It reduce dependency of code. Another is that, How injected 

Spring Framework Questions

What are the types of Dependency Injection Spring supports
What are the types of Dependency Injection Spring supports  Hi, What are the types of Dependency Injection Spring supports 

Spring Framework Questions

spring - Spring
spring  hi how to use work ioc in spring. Regards Venkatesan  Hi Friend, Please visit the following link: Here you will get the explanation of IOC and AOP. Thanks 

Java Technology Tutorials

An introduction to spring framework
of Spring, Inversion of Control (IoC) and Aspect Oriented Programming. Spring is based on dependency injection type of IoC . We don't directly connect our... SPRING Framework... AN INTRODUCTION 

Spring Framework

Spring Security Maven Dependency
Spring Security Maven Dependency In the below section, you will learn about maven dependency of Spring Security. The pom.xml is a XML file that contains... the project . Given below the pom.xml of Spring Security : <project xmlns 

Spring Framework Questions

spring questions - Spring
spring questions  what is framework? what are the main objectives of Spring? what IOC ? what it can do 

Spring Framework

Constructor Based Dependency Injection in Spring
Constructor-based dependency injection In the constructor-based dependency...;bean.display("hello spring");   .../beans  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 

Spring Framework

Spring Inversion Of Control (IOC)
Spring Inversion Of Control (IOC) The Spring framework provides a powerful... Of Control and it is implemented by Dependency Injection design pattern. The container is responsible for choosing the resources here. An example of IOC 

Framework Questions

need of Ioc - Framework
need of Ioc  what is IOC in spring framework?  Hi Friend, Please visit the following link: http://www.roseindia.net/spring/springpart1.shtml Hope that it will be helpful for you. Thanks 

Spring Framework

What is Spring?
What is Spring?       Spring is great framework for development of Enterprise grade applications. Spring is a light-weight framework for the development 

Programming Tutorials

Spring Framework, Spring Framework in Java
use Spring IOC to manage your beans and dependency among the beans. Spring... classes for writing and executing the test cases The Spring IOC module... the beans and its dependency in the application. the latest version of Spring 

Spring Framework Questions

Setter injection in Spring
Setter injection in Spring  What is Setter injection in Spring ?   The Spring IoC container supports setter injection, which is the preferred method of dependency injection in Spring. Setter injection uses the set 

Spring Framework Questions

jquery dependency dropdown box in spring hibernate my sql
jquery dependency dropdown box in spring hibernate my sql  Hi Friends, Can you please provide me the code for dynamic drop down box using jquery in spring, hibernate and oracle/mysql database. Like if i select country 

Spring 3

Introduction to spring 3, Spring framework 3
the components selectively. You can use IoC container of spring and any other MVC... may have dependency on the Spring libraries. The Spring Framework allows you...Introduction to spring 3 In this section we will discuss about Spring

Spring Framework Questions

Using JUnit to test struts application that uses Spring to manage object dependency - Spring
pattern and the dependency is managed by Spring. I am now getting NullPointers...Using JUnit to test struts application that uses Spring to manage object... cases and test in-container. I am using Struts as the framework and Spring 

Spring Framework Questions

What is IOC ?
What is IOC ?  HI, What is IOC or Dependency Injection? Thanks 

Spring Framework

Spring MVC, Spring MVC Module Tutorial
The IoC container provides the important functionality of the dependency... Spring MVC - Spring MVC Introduction      In this example we will give you quick overview of Spring MVC 

Spring Framework

Roseindia Spring Tutorial
(IoC), dependency injection, bean, Spring MVC and much more on spring in easy...Roseindia Spring tutorials provide you complete coverage of wide range of spring framework topics to help you create dynamic and advance web applications 

Spring Framework

Spring Tutorial for Beginners
of control (IoC), dependency injection and moves to the more complex topics...The Spring Framework is an open source Java platform through which... for the Java platform. Spring Framework was first written by Rod Johnson in his 

WebSevices Questions

spring
spring  Access JSP files in Spring 

JNDI Questions

spring
spring  javascript browse image in spring progrme 

Spring Framework Questions

spring
spring  how to upgrade from struts2 to spring 

Spring Framework

Spring 3.0 Tutorials with example code
3 asm Dependency, Spring cglib Download Code... Spring 3.0 - Tutorials and example code of Spring 3.0 framework In this Spring 3.0 tutorial you will learn Spring 3.0 with the help 

WebSevices Questions

spring
spring  sir how to access multiple jsp's in spring 

Spring Framework

Spring Framework Tutorials
beginning from environment setup, inversion of control (IoC), dependency injection...Spring Tutorials The Spring Framework is an open source Java platform, which.... Spring Framework was first written by Rod Johnson and was for the first time 

Java Beginners

spring
spring   i am a beginner in java.. but i have to learn spring framework.. i know the core java concepts with some J2EE knowledge..can i learn spring without knowing anything about struts 

Spring Framework Questions

Spring
Spring  What is AOP concept in spring? How AOP concept differ from DI concept 

Spring Framework Questions

spring
spring  sir can you explain me the flow of sample example by using spring? thanks 

Spring Framework Questions

spring
spring   package bean; public interface AccountsDAOI{ double... normally. i set the classpath=D:\java softwares\ST-IV\Spring\spring-framework-2 .5.1\dist\spring.jar;D:\java softwares\ST-IV\Spring\spring-framework-2.5.1\lib\c 

Spring Framework Questions

Spring
the following links: http://www.roseindia.net/spring/ http://www.roseindia.net/spring 

Spring Framework Questions

Spring
the following links: http://www.roseindia.net/spring/ http://www.roseindia.net/spring/bean-init.shtml http://www.roseindia.net/spring/spring3/spring-3-hello 

Struts-Tutorials

Difference between Struts and Spring
. Spring works on Dependency Injection concept aka Inversion of Control (IoC...To know the difference between Struts and Spring, we must first explain and understand both the frameworks a little. Spring framework is a Java platform 

Spring Framework

Spring Architecture
applications. Spring Core: component provides the Dependency Injection features...Spring Architecture Spring is a light-weight framework that is used for the development of Enterprise-ready applications. The architecture of Spring forms 

Spring Framework Questions

spring - Spring
spring  what is Session Factory in spring 

Spring Framework Questions

spring - Spring
spring  what is the use of HashTable concept in spring 

Spring Framework Questions

spring - Spring
spring  give me the explanation about spring>and give me the difference between spring and EJB 3.0 WHAT IS THE USAGE OF SPRING WHERE WE HAVE TO USE IT? GIVE ME ONE EXAMPLE 

Spring Framework Questions

spring - Spring
spring  Hi sir how compile spring application on jboss5.1.0 server how run spring application on jboss5.1.0 server thanks 

Spring Framework Questions

Spring
 

Spring Framework Questions

spring - Spring
spring  what is the use of spring  Hi Friend, Spring is grate framework for development of Enterprise grade applications. Spring.... Spring can be used to configure declarative transaction management, remote access 

Spring Framework Questions

SPRING - Spring
SPRING  In spring frame work when applicationcontext.xml will be load into the contianer i want answer plz replyyyyyy 

Spring Framework Questions

spring - Spring
spring  how spring is light weight? please tell me this i want to know 

Spring Framework Questions

spring - Spring
spring   hi, I need sample example user update profile using spring with hibernate and spring jsp. I need the sample code very urgently. Please... the following link: http://www.roseindia.net/struts/hibernate-spring/index.shtml 

Spring Framework Questions

spring - Spring
spring  i want to work in spring.i m new to spring. i have download the springframework 2.5.4 , i dont know how to use this in eclipse 3.3. i m... information. http://www.roseindia.net/spring 

Spring Framework Questions

@configuration annotation in Spring 3
@configuration annotation in Spring 3  doesn't make code tight coupling..? if we keep that in IOC in XML form, its deployment free for some kind of change management right?.   Please visit the following link: http 

Spring Framework Questions

spring - Spring
spring  what is the difference between spring and hibernate and ejb3.0  Hi mamatha, Spring provides hibernate template and it has many.... * Spring hibernateTemplate also throws RunTime exception compared to checkd 

Spring Framework Questions

spring - Spring
spring  sample code for formvalidation by using spring with javascript as presentation ex textboxes like dept id dept name Submit.../spring/userregistration.shtml Hope that it will be helpful for you. Thanks 

Spring Framework Questions

spring - Spring
spring  i want to work in spring.i m new to spring. i have download the springframework 2.5.4 , i dont know how to use this in eclipse 3.3. i m using JBOSS server. help me plz 

Spring 3

Spring 3, Spring 3.0, Spring Framework, Spring Framework Tutorial
Spring 3 In this tutorial we will learn Spring 3 Framework with the help of many articles and example. We have developed the tutorials covering major spring technologies. Let's get started with the Spring 3. In the Spring 3 many 

Free Magazine

Remoting with Spring
Remoting with Spring           Spring features remoting support using various technologies... with usual (Spring) POJOs. Currently, Spring supports different remoting 

Spring Framework Questions

Spring and Eclipse - Spring
Spring and Eclipse  How to add Spring API Docs to Eclipse 

Spring Framework Questions

Spring - Spring
 

Spring Framework Questions

Spring - Spring
 

Spring Framework Questions

spring - Spring
 

Spring Framework Questions

spring - Spring
 

Spring Framework Questions

Spring - Spring
 

Spring Framework

Why to use Spring Framework?
not require the Spring dependency directly and does not directly depend... of the Spring framework and it works on the Dependency Injection and Inversion... the dependency in their program and the Spring Framework satisfies the dependencies 

Spring 3

Spring MVC Tutorials
Features Spring 3 IoC Container Tutorial and example code...Spring MVC Tutorials and example code In this section I will provide you the list of Spring MVC Tutorials which is very useful for a beginner in Spring MVC 

Spring Framework Questions

Jsf integration - Spring
Jsf integration  hi I'm integrating JSF(richfaces), Spring... to Spring. the scenario is like i hav a property called 'username' where i defined... 'login.jsp' to #(LoginBean.validuser) via action atrribute of submit button 

Spring 3

Spring Web, Spring Web Modules, Spring Web Example
and initialization of the Spring IoC container with the help of servlet listener...Spring Web In this section we will discuss about the modules of Spring Web layer. The Spring Web modules allows the developers to develop/manage web 

Spring Framework Questions

java spring simple application
java spring simple application  hai I have design a simple.../beans/spring-beans-2.5.xsd"> <bean id="studbean" class="StudentComponent" abstract="false" lazy-init="default" autowire="default" dependency 

Hibernate Tutorial Example

Hibernate 4.2.8 Maven dependency
Adding Hibernate 4.2.8 Maven dependency in a project How to add the Hibernate 4.2.8 Maven dependency in a project? The Maven is industry standard build tool... to specify the dependency of Hibernate 4.2.8  in your project 

Hibernate Tutorial Example

Hibernate 4.2.7 Maven dependency
Adding Hibernate 4.2.7 Maven dependency in a project How to add the Hibernate 4.2.7 Maven dependency in a project? The Maven is industry standard build tool... to specify the dependency of Hibernate 4.2.7  in your project 

Spring Framework Questions

spring security - Spring
spring security  Can i use spring security concept acegi for any type of java applications 

Spring Framework Questions

Spring Question - Spring
Spring Question  Sir what is difference between spring session and jsp session 

Spring Framework Questions

spring MVC - Spring
spring MVC  what is the use of applicationcontext.xml,[servelt-name]-servlet.xml,properties file in spring MVC module 

Spring 3

The registerShutdownHook in spring
.style1 { background-color: #FFFFCC; } The registerShutdownHook in spring If you are using Spring IoC in non web application and want...://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> </beans> 

Spring Framework Questions

what is diffrence between the spring and ejb which is better for small application - Spring
-managed remote method calls whereas Spring provides proxying for remote calls via...what is diffrence between the spring and ejb which is better for small application  what is diffrence between the spring and ejb which is better 

Spring Framework Questions

Spring mvc
Spring mvc  what is spring mvc 

Spring Framework Questions

spring with jms
spring with jms  examle for spring with jms 

Spring Framework Questions

RichFaces + Spring Connectivity - Spring
RichFaces + Spring Connectivity  Hi We are having requirement of using RichFaces with Spring Framework. When the user fills out all the forms information(textbox) and clicks submit, then how to retrieve the value within Spring 

Spring Framework Questions

Tutorial for spring - Spring
.  Hi friend, I am sending book name of spring framework. 1. Beginning Spring Framework 2. 2. Spring in Action, Second Edition Beginning Spring Framework 2 shows beginning Java developers how to build server side Java 

Spring Framework Questions

Spring Usage - Spring
Spring Usage  Hi This is Chandra Mohan, I want to work with Spring. SO, i want to working with spring, what are the API's required i.e. how to set the classpath,jar files and Structure of the Spring project. Please 

Spring Framework

Spring cglib2
include the cglib dependency in your Spring 3 project you might get... Spring cglib       In this section we will learn about Spring cglib library 

Spring Framework Questions

spring with hibernate - Spring
spring with hibernate   Hi, I need the sample code for user registration using spring , hibernate with my sql. Please send the code as soon as possible. I need Spring with Hibernate code not struts. Thanks, Valarmathi 

Spring Framework Questions

spring web - Spring
spring web  hi thanku for reply :) Actually i dint get u what is meaning of spring web as i understand i am telling you. I am using eclipse and jar files like spring.jar,tlds of spring. hibernet.jar and also required jars 

Spring Framework Questions

Spring Duplicate submit - Spring
Spring Duplicate submit  hi, i have problem in spring, i am pressing back or refresh my request get submitted again what i can do to avoid this,i am using only spring not struts 

Hibernate Questions

spring hibernate spring
spring hibernate spring  why are all the links in the following page broken. http://www.roseindia.net/struts/hibernate-spring/integrate.shtml... the following link: Spring Hibernate Thanks 

Spring Framework Questions

spring 2.5 - Spring
spring 2.5  Hi deepak, i've a problem populating the select drop down in spring. i m pasting the relevant codes in the box. plz have a look and suggest me the remedy. potion from selectivepriceincrease.jsp 

Spring Framework Questions

Spring Framework Training - Spring
Spring Framework Training  THinking of taking spring framework training from Intertech. Here's the class... does this give me what I need? http://www.intertech.com/Courses/Course.aspx?CourseID=99468 

Spring Framework Questions

Spring MyEclipse Code - Spring
Spring MyEclipse Code  How To Configure Spring in MyEclipse ?  Hi Friend, Please visit the following link: http://www.roseindia.net/spring/spring3/spring-3-hello-world.shtml Hope that it will be helpful for you 

Spring Framework Questions

spring Web Services - Spring
spring Web Services  Hi, Can any one explains or give me some example which gives me that how to start up spring web services. Thanks, mahi 

Training

Spring Training
Spring Framework Training for the Developers   ...; Hands-On: 70%  The Spring Framework training is specially designed for the java programmers looking for a start up in the Spring Framework and use 

Spring Framework Questions

spring mvc - Spring
spring mvc  hi referenceData() in SimpleFormController never called. use this for dropdown list in insert screen. With Regards Venkat 

Spring Framework Questions

Spring ApplicationContextAware
Spring ApplicationContextAware  What is the exact usage of ApplicationContextAware interface in spring 

Training

Java Spring Online Training
the learners get to learn Spring's inversions of control and dependency...Java Spring Online Training Java spring training online is sought... container. Spring is a wide spectrum framework designed to facilitate different 

Spring Framework Questions

spring MVC frame work - Spring
spring MVC frame work  Example of spring MVC frame work 

Spring Framework Questions

file upload in spring - Spring
file upload in spring  Is it necessary to use Multipart support in spring framework for file uploads.If not please let me know the other ways to do 

Spring Framework Questions

Where to implement spring - Spring
Where to implement spring   Hi, Where we implement spring framework in j2ee appplication. I mean which layer .Thanks 

Spring Framework Questions

spring with hibernate - Spring
spring with hibernate   Hi, I need the sample code for user registration using spring , hibernate with my sql. Please send the code as soon... the following link: http://www.roseindia.net/struts/hibernate-spring/user-registration 

Spring Framework Questions

Spring examples - Spring
Spring examples  Hi, I need sample program using Spring. Full floww o f the code using tiles ,controller,view,model... Please send the sample.../spring/index.shtml Hope that it will be helpful for you. Thanks 

Spring Framework Questions

Spring examples - Spring
Spring examples  Hi, I need the sample example for how to retrieve the values from jdbc using spring. Please send the sample example immediately... visit the following link: http://www.roseindia.net/spring/jdbc-template-batch 

Advertisements Advertisements
 

 

 

DMCA.com