Interfaces | Implementations | ||||
---|---|---|---|---|---|
Hash table | Resizable array | Tree | Linked list | Hash table + Linked list | |
Set | HashSet | TreeSet | LinkedHashSet | ||
List | ArrayList | LinkedList | |||
Queue | |||||
Map | HashMap | TreeMap | LinkedHashMap |
Thursday, August 23, 2007
Collection
Posted by iCehaNgeR's hAcK NoteS at 4:27 PM 0 comments
SAX V/S DOM
Instead of reading a document one piece at a time (as with SAX), a DOM parser reads an entire document. It then makes the tree for the entire document available to program code for reading and updating. Simply put, the difference between SAX and DOM is the difference between sequential, read-only access, and random, read-write access.
When to use DOM
If your XML documents contain document data (e.g., Framemaker documents stored in XML format), then DOM is a completely natural fit for your solution. If you are creating some sort of document information management system, then you will probably have to deal with a lot of document data. An example of this is the Datachannel RIO product, which can index and organize information that comes from all kinds of document sources (like Word and Excel files). In this case, DOM is well suited to allow programs access to information stored in these documents.
However, if you are dealing mostly with structured data (the equivalent of serialized Java objects in XML) DOM is not the best choice. That is when SAX might be a better fit.
If the information stored in your XML documents is machine readable (and generated) data then SAX is the right API for giving your programs access to this information. Machine readable and generated data include things like:
Posted by iCehaNgeR's hAcK NoteS at 4:21 PM 0 comments