Announcement Announcement Module
No announcement yet.
Inject Dependency into Object Created at Runtime Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inject Dependency into Object Created at Runtime

    I have a class that gets invoked remotely from Flex, call it FooService. When FooService.getData() is invoked it does something like:

    public Object getData() {
    Bar b = new Bar();
    return b.getMessage();

    Now, the Bar object has a dependency on an object defined in my application context. Right now, the Bar class is manually getting the bean out of the context.

    How can I make this better so that my Bar object doesnt have to get the bean it needs and that the FooService can still get new Bar objects when it needs them??

  • #2
    think this is what i need: