Results 1 to 2 of 2

Thread: Creation of beans.xml from pre-populated object graph...

  1. #1
    Join Date
    Oct 2004
    Posts
    11

    Default Creation of beans.xml from pre-populated object graph...

    Hi,

    I'd like to use Spring's "beans.xml" file almost as a configuration file that instantiates, populates, and "wires together" beans for later use within an application. This is easily done. However, I also need the ability to do the INVERSE of this. Within an application, a graph of objects is created though some means, and I would like to save the state of this object graph as a "beans.xml" file, so that at some other time, I could recreate the graph, with the possibility of "by hand" modifying some values in the xml.

    I know this sounds similar to an xml marshalling/unmarshalling framework (XStream, XMLBeans, etc.), but really it's more powerful... for the same reason we choose to "wire" objects via Spring over "unmarshalling" via some other framework.

    I would say the idea is more similar to the way Apache Ant tasks work... a graph of objects is created, so that an application can later execute a given task, which is all setup and ready to go. However, Ant doesn't offer the ability to do the inverse either.

    Now, before Spring came out (or became popular), I wrote a framework that would do what I need. I have been using it for years, and it works great. The problem is, I finally found the need to revisit some things in order to implement a few new features. However, Spring as a whole, offers so much more than my framework does, and unfortunately the xml is incompatible. So I find myself in the situation where I want to CLONE the way Spring wires together objects, and then implement the "inverse" as well. I feel like that this is replicating a lot of work, and furthermore, would require me to "upkeep" the framework to ensure Spring compatibility in the future.

    I hate to make such a request, but I feel that the developers of the Spring framework could implement this quicker than I could because they are already familiar with the internals of the code. The pattern is really just to inverse the way the object graph is populated from the xml. The only thing to really worry about is when objects aren't instantiated using a "default" no-argument constructor, but this is something that could be solved very nicely using Spring AOP... by creating a MethodInterceptor that keeps track of objects that are instantiated via non-default constructors, or static/non-static bean factories.

    I think this would also tie in very nicely with the [hopefully] up and coming feature of hot-deployment. Imagine being able to write out an already existing object graph, edit a few values that were perhaps erroneous or needed to be modified for testing purposes, and then having the changes in the graph occur... all during runtime!

    Do any of the current Spring developers think that this could be a possibility in the future?

    Thank you.

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Please log a request on JIRA.
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

Similar Threads

  1. Replies: 2
    Last Post: Oct 10th, 2005, 05:12 PM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  4. Proposal for Object Graph Assembler
    By garpinc2 in forum Web Flow
    Replies: 6
    Last Post: May 11th, 2005, 10:37 PM
  5. Replies: 0
    Last Post: May 9th, 2005, 12:48 PM

Posting Permissions

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