B
BogusException
Given:
A class designed to:
1. Take an object in through one of its methods,
2. Read and add new attributes to that object,
3. Return this new object to the calling class.
This works fine as long as everything is known way ahead of time.
Suppose, though, that the class does not always have the same object
in, yet it just needs to find the object's attribute it needs? This is
the problem, and I can't decide if there is a better way via XML or
Java objects to do it.
If you've read this far, let me give you more detail:
I want to have a series of classes that do specific things to an object
(could be an XML object, or...). Each class looks for something in
particular in each data parcel and acts upon it. This could very well
mean adding another "attribute", "element" or characteristic to the
object, then passing it on its way. The classes are often in a
different "order", so I can't code in every possible position in the
line of processing classes.
With a rigid object structure, adding new attributes can't happen
unless you know ahead of time the name and type of attribute. Could it
be done with an array of objects? Probably, but that isn't a generic
solution.
I thought about XML, and passing the schema for the XML document with
the document itself but I can't seem to find a match for Java to do
this with JAXP, JAXB, Dom or Sax. I don't want the data to ever be
written to file-only transferred between classes (instantiated objects)
at runtime in memory.
The data may have many occurances in a single XML doc/Java object, and
the preference is toward speed-not toward random access.
Any ideas as to which Java solution is best for this kind of need?
TIA!
BogusException
A class designed to:
1. Take an object in through one of its methods,
2. Read and add new attributes to that object,
3. Return this new object to the calling class.
This works fine as long as everything is known way ahead of time.
Suppose, though, that the class does not always have the same object
in, yet it just needs to find the object's attribute it needs? This is
the problem, and I can't decide if there is a better way via XML or
Java objects to do it.
If you've read this far, let me give you more detail:
I want to have a series of classes that do specific things to an object
(could be an XML object, or...). Each class looks for something in
particular in each data parcel and acts upon it. This could very well
mean adding another "attribute", "element" or characteristic to the
object, then passing it on its way. The classes are often in a
different "order", so I can't code in every possible position in the
line of processing classes.
With a rigid object structure, adding new attributes can't happen
unless you know ahead of time the name and type of attribute. Could it
be done with an array of objects? Probably, but that isn't a generic
solution.
I thought about XML, and passing the schema for the XML document with
the document itself but I can't seem to find a match for Java to do
this with JAXP, JAXB, Dom or Sax. I don't want the data to ever be
written to file-only transferred between classes (instantiated objects)
at runtime in memory.
The data may have many occurances in a single XML doc/Java object, and
the preference is toward speed-not toward random access.
Any ideas as to which Java solution is best for this kind of need?
TIA!
BogusException