Proposal of a Standard to Solid OO Solution to Server-Side Architectures | ||
---|---|---|
Prev | Chapter 3. XMLarized Objects | Next |
The proposed solution introduces set of xObjects which standardize the design strategy for converting any data into XML format and also significantly increases the performance. The next section discuss the advantages in more detail and then the idea of xObjects is explained in deeper detail on the "page" example.
Figure 3.6: Data Flow Diagram: xObject solution
The proposed solution is here to address all the mentioned disadvantages of the previous one so here comes the list of advantages.
Better memory management and smaller CPU load
On demand late data retrieval technique: is used which greatly decreases the memory footprint. Instead of generating huge string containing the whole "InputDocument" and holding it in memory for further processing, the xObject tree is constructed where each of the xObjects supplies the data by small chunks and only on demand.
For example, when converting a list of products stored in a database, then each database record can be converted one by one. This feature might cause an effect where part of the "InputDocument" is already processed --- transformed into HTML and sent to the client (HTML browser) --- and the other part of the document data is just about to be retrieved from the database.
Approach of a "request context": is proposed. It makes possible a construction and reuse of the xObject tree. This speeds up the execution because the tree is created only once (during startup time) instead of allocating and disposing all of the xObjects for each request execution.
Better design
Design pattern: is suggested, which standardize the way of designing the object XMLarization. It also provides with a library of standard components which simplifies the design significantly. The next example (figure 3.6) will illustrate.
since this approach uses standard component for representing the xObject, it makes easier the consolidation of the "InputDocument" which might consist of many distinct elements. The advantage is that the component procession the XML works with the actual objects (rather then parsing a string) but does not know and does not care about the implementation, where the data is coming from and what was the original data format.
The xObject tree also defines the requesting structure of the "InputDocument".
Future enhancements: * configurable * structure builder