we are developing an application that should
- receive XML documents
- display lists of received documents
- archive the original documents
- make plausibility checks using data from a database
- alter the original documents
- create PDF out of the XML documents
This application will be part of a bigger B2B application that allready runs. This B2B application is realized with EJBs (2.0) and Struts for the web layer. We are strictly using the common patterns (especially Data Transfer Objects) in our architecture.
The XML document part should handle a set of different documents (trade documents) and should be realized in successive 'waves'. In the first 'wave' all document types should be archived but only one document type should be checked for plausibility. For the plausibility checks only very few attributes of the document are necessary. In the subsequent waves more documents types should be checked for plausibility and more attributes will take part in these checks.
So for now I only need a small DTO for the first document type and only the XML for the others. The 'small' DTO should present a small 'window' into the associated XML. Simply speaking I need a method that takes a XML doc and returns an DTO and another method that takes a (maybe modified) DTO and returns the complete XML document.
I currently wonder what architecture we should use to realize this quickly and extensible, because the next 'waves' are lurking around the corner. With these waves the first DTO (not the XML) will grow and other DTOs will come along.
I hope you understood my messy problem description and have architectural proposals for me.
Nobody answered yet, so maybe I did not make my point clear enough. I think I'll try it again:
I am looking for an architecture that binds an DTO to an XML document without modelling all attributes that are described in the XSD but only a small portion that may grow when time passes by. For the developer it should be transparent, if he works with the XML or the DTO. That means every modification in the DTO should be mirrored in the XML document and vice versa.
I think I will need this, because a part of the application uses only the XML 'representation' of a real-world document (for translation to PDF), and the other part only uses a DTO 'representation' (for plausibility checks). And I really don't want to call translation methods (parsing / generating) everytime I use one of the documents representation types.
Thanks for your time.
What about using Bea's XMLBeans?
I know it is still in the beta phase and haven't used it myself, but would like to know if anyone has made some experiences with this technology he would like to share?