Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Spring Questions on Spring
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Deepak Lal
Questions on Spring
2 Answer(s)      6 years and 2 months ago
Posted in : Spring



Advertisement
View Answers

November 13, 2008 at 1:06 AM


Hi friend,


The Spring Framework provides solutions to many technical challenges faced by Java developers and organizations wanting to create applications based on the Java platform. Because of the size and complexity of the functionality offered, it can be hard to distinguish the major building blocks from which the framework is composed. The Spring Framework is not exclusively linked to the Java Enterprise platform, although its far-reaching integration in this area is an important reason for its popularity.


With inversion of control , instead of executing application code at startup, a library called a framework is called. The framework then invokes the application code. The goal of inversion of control is to create a separation between the code itself and how the various pieces of code are connected together. It makes code much more readable.

There are two types of inversion of control: dependency injection and dependency lookup. In both cases, the framework instantiates the applications? objects. In the case of dependency injection, the framework knows how the dependencies of the objects are to be set. In the case of dependency lookup, the framework will ask the objects itself how their dependencies are to be set.

------------------------

Spring reads the dependencies from an xml file, usually called applicationContext.xml, that (appart from the formatting which I can?t get right) looks as follows:


<bean id="frontend" class="com.soccer.frontend.FrontendImpl">
<property name="matchService" ref="matchService"/>
<property name="clubService" ref="clubService"/>
</bean>

<bean id="matchService" class="com.soccer.service.MatchServiceImpl">
<property name="matchDao" ref="matchDao"/>
</bean>

<bean id="clubService" class="com.soccer.service.clubServiceImpl">
< property name="clubDao" ref="clubDao"/>
</bean>

<bean id="matchDao" class="com.soccer.data.dao.matchDaoImpl">
< property name="database" ref="database"/>
</bean>

<bean id="clubDao" class="com.soccer.data.dao.clubDaoImpl">
< property name="database" ref="database"/>
</bean>

<bean id="database" class="com.soccer.data.database.DatabaseImpl">
< property name="username" value="user"/>
< property name="password" value="secret"/>
< property name="url" value="jdbc:mysql://localhost:3306/soccer_db"/>;
</bean>


November 13, 2008 at 1:08 AM


Aspect-Oriented Programming(AOP) complements Object-Oriented Programming (OOP) by providing another way of thinking about program structure. In addition to classes, AOP gives you aspects. Aspects enable modularization of concerns such as transaction management that cut across multiple types and objects. (Such concerns are often termed crosscutting concerns.)

One of the key components of 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 to provide a very capable middleware solution.



-----------------------------------------------------

Visit for more information.

http://www.roseindia.net/spring/

Thanks.


Related Tutorials/Questions & Answers:
Questions on Spring - Spring
Questions on Spring  1> what is Spring Framework ? why does... in Spring ? 3> what is Spring - Aspect Oriented Programming,Please explain with a working Example for Spring - Aspect oriented Programming Concept.?  
spring questions - Spring
spring questions  what is framework? what are the main objectives of Spring? what IOC ? what it can do
Advertisements
spring question - Java Interview Questions
spring question  what is quartz API in spring
Spring question - Java Interview Questions
Spring question  Hi Pls any one give idea abot this question? in the above statement, what is the meaning og abstarct = true? Thanks In Advance   Hi friend, Read for more information. http
Ask Spring Questions Online
Ask Spring Questions Online       Spring is an open source application Framework for Java platform and .NET Framework. The prime feature of Spring
spring
spring   hi how can we make spring bean as prototype how can we load applicationcontext in spring what is dependency injection
spring
spring  Access JSP files in Spring
spring
spring  javascript browse image in spring progrme
spring
spring  how to upgrade from struts2 to spring
spring
spring  sir how to access multiple jsp's in spring
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
Spring  What is AOP concept in spring? How AOP concept differ from DI concept
spring
spring  sir can you explain me the flow of sample example by using spring? thanks
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
the following links: http://www.roseindia.net/spring/ http://www.roseindia.net/spring
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
Spring
Spring  I understand spring as dependency injection. It can avoid object creating and can directly inject values. But i am comfusing that Dependency... are created. By the same way i want to know how spring injected property
spring - Spring
spring  what is Session Factory in spring
spring - Spring
spring  what is the use of HashTable concept in spring
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 - Spring
spring  Hi sir how compile spring application on jboss5.1.0 server how run spring application on jboss5.1.0 server thanks
spring - Spring
spring  how spring is light weight? please tell me this i want to know
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 - 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 - Spring
SPRING  In spring frame work when applicationcontext.xml will be load into the contianer i want answer plz replyyyyyy
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 - 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
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 - 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 - 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 and Eclipse - Spring
Spring and Eclipse  How to add Spring API Docs to Eclipse
Advertisements
 

 

 

DMCA.com