InterviewSolution
| 1. |
Jdom Ensures The Document In Memory Is Always Well-formed. Can Jdom Also Ensure The Document In Memory Is Always Valid? |
|
Answer» No, it's our current belief that it's better to expose a check Valid () type of call than to attempt constant validation checking. One reason is performance. A second reason is that you have a chicken-and-egg PROBLEM where for example an element needs exactly two child elements to be valid, but after ADDING either child the document will be in a TEMPORARILY invalid state. To work around this would REQUIRE something like transactional modifications, and that's a lot of overhead for little gain. No, it's our current belief that it's better to expose a check Valid () type of call than to attempt constant validation checking. One reason is performance. A second reason is that you have a chicken-and-egg problem where for example an element needs exactly two child elements to be valid, but after adding either child the document will be in a temporarily invalid state. To work around this would require something like transactional modifications, and that's a lot of overhead for little gain. |
|