2023 2024 Student Forum > Management Forum > Main Forum

 
  #1  
16th February 2017, 05:30 PM
Unregistered
Guest
 
IOC Example In Spring

Hi I am doing a JAVA course from a institute right now so need to get an IOC example in spring framework so can you please help me in the same???
Similar Threads
Thread
Spring Concert CCSU
Spring MBA programs
Spring CCSU
DCE Spring Break
IIT Roorkee Phd Spring
Spring MBA Programs
HMT Spring Watches
Spring Semester IIT Bombay
MBA Spring Start
Spring Semester IITB
Day Care Spring TX
JKMBA Spring
Spring MBA
MBA Spring Deadlines
Pest Control Spring TX
JkMBA spring jcu singapore MBA
IIT Roorkee Spring Semester
NIT Warangal Spring Fest
CSU FT Collins Spring Break
IIT Spring Fest
  #2  
17th February 2017, 04:32 PM
Super Moderator
 
Join Date: Mar 2013
Re: IOC Example In Spring

Well the core of the Spring Framework is its Inversion of Control (Ioc) container.

The IoC container manages java objects – from instantiation to destruction – through its BeanFactory.

Java variants that are contained by the IoC container are known beans, and the IoC container settles a bean's scope, lifecycle events, and any AOP variants for which it has been managed and coded.

A Spring bean in the IoC container can typically be any POJO (plain old java object).

POJOs in this context are defined simply as reusable modular components –

Example 1. DefaultMessage


public class DefaultMessage {

private String message = "Spring is fun.";

/**
* Gets message.
*/
public String getMessage() {
return message;
}

/**
* Sets message.
*/
public void setMessage(String message) {
this.message = message;
}

}

If the container instincts the message bean, it is equal to initializing an object in your code with new DefaultMessage()


Quick Reply
Your Username: Click here to log in

Message:
Options




All times are GMT +5. The time now is 01:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
SEO by vBSEO 3.6.0 PL2

1 2 3 4