Factory Method: XML Exercise
Factory Method Exercise
The code for this exercise deals with two XML Builders - a plain vanilla
You guessed it! On the next page you'll witness this tedious duplication for yourself.
XMLBuilder
, and a more sophisticated DOMBuilder
— both of which allow clients to build XML.There is quite a bit of duplicated code within the methods of these XML Builders. I get it! You want us to use a Factory Method to remove the duplication in these Builders, right?
(Reading...)
Formatting Hints:
To format... | use this markup: |
---|---|
source code | {source:lang=java|lineNumbers=false}...{source} (Supported languages: java, cpp, csharp, c, python.) |
bold text | __some text__ |
italicized text | ~~some text~~ |
underlined text | @@some text@@ |
a method or class name | ``myMethod(...)`` |