Hi,
Ok, I have landed myself into a tricky place and don�t now how to get out of it [nothing new in that]
In our application, we use XML extensively for communication with external systems while the data is maintained internally in the application as DTO�s [Data Transfer Objects] or DVO�s [Data Value Objects] or
Java Beans with just getter/setter methods or whatever the terminology used.
The data travels in the form of java objects internal to the application, while when we need to publish the same externally we convert the same into XML as I guess is the standard.
The issue is, for conversion of the xml to java objects and vice versa we have an itsy bitsy utility class which traverses through the nodes and child nodes and gives a definite object structure to it. We use reflection in here for mapping the node name to java class which gets instantiated at runtime and the node traversal is written in a recursive loop.
Now the technical architect is sitting on my head and wants to do away with the twin R&R as he says they are costly processes.
I ran load tests and found that I/O for reading some properties [which again is done only once] is much more costly as compared to part of code which is being marked for being a performance hog as in the Reflection and Recursion stuff. I also visited sites which warn again going in for the Twin R�s and in fact reflection is considered a down right performance hog but I do not see that happening in the code.
We did the memory profiler and GC checks to map the memory consumptions and objects being created and they seemed all right.
PS: we also tested out utilities like castor, but they provide functionality way beyond our requirement and there are some issues on open/third party API�s so the code has to be ours.
PS1: The thing works, and it works beautifully as of now [or at least that is what I think]. My doubt is will it be a drag in production.
PS2: Sorry my question goes as do I really look for alternatives for the code as it uses stuff which is not considered the Ferraris, ok sorry Renault�s of java and is reflection really such a bad kid in the java family.
Thank you.