Chapter 4 XML Processing
159
Figure 4.10 shows the class diagram for a basic XML document editor design,
while Figure 4.11 shows the class diagram for an XML document editor factory
design. You should consider using a similar design in the following situations:
When you want to keep the business objects focused on business logic and
keep code to interact with XML documents separate from business logic code.
In a similar way, when you want to keep the Web service endpoints focused on
interaction logic and keep code to pre and post process XML documents sep
arate from interaction logic code.
Interface
XMLDocumentEditor
XMLDocument
EditorFactory
+setDocument:void
+getDocument:Source
+copyDocument:void
creates
obtains
DomainSpecificXDE
BusinessObject
Interface
+setDocument:void
uses
+getDocument:Source
javax.xml.trans
encapsulates
+process:void
+copyDocument:void
form.Source
+edit:Source
+getXXX:
DomainSpecificObject
+setXXX:void
creates, extracts/inserts
obtains/modifies
DomainSpecificObject
assigns/retrieves
Figure 4.11
Factory Design to Create Schema Specific XML Document Editors
New Page 1