I don't really understand how XMLBeanFactory can get away without the
equivalent of Digester's rules, unless the java class names, attribute
names, etc *must* map 1:1 with the xml element/attribute names.

Well, XMLBeanFactory isn't promising to be as universally useful at processing XML as Digester, which is how it can get away without requiring rules to be defined.


The XMLBeanFactory encounters any number of "bean" elements, which implicitly mean "object-create", but instead of pushing them on a stack, it puts them in a map (effectively, at least). Then it has a standard set-property element, which does what you would expect. However, the contents of set-property can be literal values or references to beans which have already been instantiated.

My most common use case for Digester is to instantiate some object and populate it with values. I think it's great that Digester can do a lot more than that, but I feel like I write the same rules over and over, just hooking them to different element names. Of course, if you don't get to define the structure of the XML you are processing, Digester has all the necessary flexibility and such, but since my XML files are usually my own invention, it's no big deal to adapt the XML to whatever tool I'm using.

I just found it convenient in this case to be able to use a name rather than a known position on the stack to make an "introduction" between two objects that were instantiated from the XML. That sounded a little like your goal to have rules that reach objects in arbitrary locations on the digester stack, so I piped up.

Note that Spring is a whole lot more than just the XMLBeanFactory, but I haven't really absorbed all those other layers; I'm not shopping for a new web app framework, etc.

Hope that helps.

Joe
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining."
-- Jef Raskin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to