Results 1 to 2 of 2

Thread: runtime dependencies

  1. #1
    Join Date
    Apr 2006
    Posts
    17

    Default runtime dependencies

    Hi,
    I'm new to Spring, I was wondering that in Spring we mention all the dependencies in configuration xml file.
    but what if i want to create instances of other classes at runtime.

    I hope my doubt is clear if not please let me know i can explain with an example.

    Thanks in advance
    Shaila

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    If you have to add new beans at runtime in a total dynamic fashion, you can do this in a programmatic way using BeanDefinition and GenericApplicationContext. In fact, such classes are used internally by Spring when the XML is parsed.
    Note that dealing with this classes is both powerful and complex - what exactly is your scenario?
    IIRC, there was a similar post a while back - besides working in a programmatic way, one can simply add later other xml configurations to the main application context.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •