18.04.2013 Views

Dissertaç ˜ao de Mestrado Mestrado em Engenharia Informática Jo ...

Dissertaç ˜ao de Mestrado Mestrado em Engenharia Informática Jo ...

Dissertaç ˜ao de Mestrado Mestrado em Engenharia Informática Jo ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. STATE OF THE ART AND RELATED WORK 2.4. Representation of Configuration Files in a Generic Syntax<br />

Being event-oriented, SAX does not impl<strong>em</strong>ent a representation of the document in m<strong>em</strong>-<br />

ory and, therefore, m<strong>em</strong>ory accesses are seldom in quantity. This leads to some m<strong>em</strong>ory in<strong>de</strong>-<br />

pen<strong>de</strong>nce and fairly good m<strong>em</strong>ory consumption ratings, also excelling in large files parsing.<br />

SAX parses in an uni-directional way since it does not allow previously read data to be read<br />

again, without restarting the parser. This consists on a probl<strong>em</strong> when a whole XML document<br />

must be in m<strong>em</strong>ory in or<strong>de</strong>r to be properly parsed, as SAX requires the user to start the parsing<br />

again to get values previously obtained.<br />

Domain Object Mo<strong>de</strong>l<br />

DOM is a cross-platform and language-in<strong>de</strong>pen<strong>de</strong>nt interface for creating and manipulating<br />

XML documents in m<strong>em</strong>ory. It is a World Wi<strong>de</strong> Web Consortium (W3C) standard.<br />

It loads an XML document to m<strong>em</strong>ory and allows for dynamic access to it, allowing for<br />

bi-directional parsing. DOM represents an XML document in m<strong>em</strong>ory in a tree-like structure.<br />

Furthermore, it is very well supported in many programming languages, including Java.<br />

Since DOM keeps a document in m<strong>em</strong>ory after it is parsed, a drawback is the time spent<br />

to parse a big file on the grounds that many m<strong>em</strong>ory allocation requests might sum up to a<br />

consi<strong>de</strong>rable time.<br />

19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!