8 ms·
I bet they were looking for extensibility. I wonder if they ever thought of providing two interfaces. 1. The first is the common case. Document doc = new
by ynd 18y ago
I bet they were looking for extensibility.
I wonder if they ever thought of providing two interfaces.
1. The first is the common case.
Document doc = new DocumentBuilder().parse("test.xml");
2. The second is more cumbersome but provides options.
Document doc = DocumentBuilderFactory.newInstance(opts).newDocumentBuilder(opts2).parse("test.xml");
- ntoshev 18y agoThis is the facade pattern :) If you need it, this means you are overengineering. Applying it is even more overengineering.
- EliAndrewC 18y agoI think the common case could be even simpler Document doc = DocumentBuilder.parse("test.xml"); no need to manually create an instance of the builder.