• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Spring Basic IOC concepts

 
Ranch Hand
Posts: 107
MyEclipse IDE Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator




























Output of this program is:
Hello-0 arg constr
SetA()
SetStr()
Hai-- 2 arg constr
SetHai()
setHello()
C-1 arg constr
Executon Starts in this way
B-m1
99
Hello Guys
C- m1
88
Hai Guys
D-m1
99
Hello Guys
99
Hello Guys
true
A- m1()
88
Hai Guys
99
Hello Guys

Q1. In this code I understand particular code.
But I am not able to find out flow. Please tell me proper flow .

Q2. ApplicationContext ctx=new ClassPathXmlApplicationContext("ApplicationContext.xml")
( code is creating container is it correct ?) What will be the timeout for container.





 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Q2. There is no such thing as a Timeout for the container. When your application finishes and closes and in this scenario the jvm stops, then the ApplicationContext goes away.

Q1. The beginning parts is about the Initialization phase of the ApplicationContext and the steps and order that they occur.
http://tech-tauk.blogspot.com/2010/11/spring-bean-life-cycle-phases.html

The initialization phase
1) Read the xml, all the xml and all the Configuration annotations in your classes and create BeanDefinition objects of it.
2) BeanFactoryPostProcessor step. Can change the BeanDefinition objects
3) Instantiate your objects, set dependenies, set properties
4) BeanPostProcessors

So in #3 above that is when your printlns are printing at the top.

Hope that helps, and hope the link explains it in much more detail for you.

Mark
 
Prakash Rai
Ranch Hand
Posts: 107
MyEclipse IDE Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am going to face my 1st interview on spring... Can anyone give me the list of interview question for spring IOC and AOP ?
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Somprakash Rai wrote: I am going to face my
1st interview on spring... Can anyone give me the list of interview question for spring IOC and AOP ?



Simple Googling will help.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Somprakash Rai wrote: I am going to face my 1st interview on spring... Can anyone give me the list of interview question for spring IOC and AOP ?


A list of interview questions ? What are you planning to do with it ? Remember it ? You think it will give you a job ? I think it would be wiser to go to the interview with what you know, rather than with what you don't.
 
Prakash Rai
Ranch Hand
Posts: 107
MyEclipse IDE Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Christophe Verré.
Really I like your suggestion... Can you tell me how can I improve my Spring skills..?
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Somprakash Rai wrote: Can you tell me how can I improve my Spring skills..?



  • Typically, start reading and practicing first to get a good exposure.
  • Once you are comfortable with the framework, read some best practices to avoid the pitfalls and also to strengthen your knowledge in it!


  • "Practice makes a man perfect!"
     
    reply
      Bookmark Topic Watch Topic
    • New Topic