• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

dependency injection without use of framework?

 
Greenhorn
Posts: 10
MyEclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can i make a program that supports dependency injection scenario, without using any framework and using xml files ?

Suppose

classA{
B b;
}

class B{
C c;
}

class C{

}

when class A requires of an object of class B , an xml file called AB.xml provide object of class B to the class A. When class B requires of an object of class C , an xml file called BC.xml provide object of class C to the class B. and so on..
please give me implementation of above scenario..
 
Master Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XML is a data format - it can't "provide" anything without code (like a DI framework) that interprets it. Can you clarify what you mean by that? There are certainly DI frameworks -like OpenWebBeans- that work without the use of config files at least for the basic use cases.
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand why you need so many xml files.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic