DocumentID: ECMA-376/Part2/AnnexG Title: ECMA-376, Part2: Annex G. Physical Model Design Considerations Extracted-From: ECMA-376 Office Open XML File Formats, 1st Edition / December 2006 Warning: Coverted to HTML format by a script known to have bugs
This annex is informative.
The physical model defines the ways in which packages are produced and consumed. This model is based on three components: a producer, a consumer, and a pipe between them.
Figure G--1. Components of the physical model
A producer is a piece of software or a device that writes packages. A consumer is a piece of software or a device that reads packages. A device is a piece of hardware, such as a printer or scanner that performs a single function or set of functions. Data is carried from the producer to the consumer by a pipe.
In local access, the pipe carries data directly from a producer to a consumer on a single device.
In networked access the consumer and the producer communicate with each other over a protocol. The significant communication characteristics of this pipe are speed and request latency. For example, this communication might occur across a process boundary or between a server and a desktop computer.
In order to maximize performance, designers of physical package formats consider access style, layout style, and communication style.
The access style in which local access or networked access is conducted determines the simultaneity possible between processing and input-output operations.
Direct access consumption allows consumers to request the specific portion of the package desired, without sequentially processing the preceding parts of the package. For example a byte-range request. This is the most common access style.
Streaming consumption allows consumers to begin processing parts before the entire package has arrived. Physical package formats should be designed to allow consumers to begin interpreting and processing the data they receive before all of the bits of the package have been delivered through the pipe.
Streaming creation allows producers to begin writing parts to the package without knowing in advance all of the parts that will be written. For example, when an application begins to build a print spool file package, it may not know how many pages the package will contain. Likewise, a program that is generating a report may not know initially how long the report will be or how many pictures it will have.
In order to support streaming creation, the package implementer should allow a producer to add parts after other parts have already been added. A Consumer shall not require a producer to state how many parts they will create when they start writing. The package implementer should allow a producer to begin writing the contents of a part without knowing the ultimate length of the part.
Simultaneous creation and consumption allows streaming creation and streaming consumption to happen at the same time on a package. Because of the benefits that can be realized within pipelined architectures that use it, the package implementer should support simultaneous creation and consumption in the physical package.
The style in which parts are ordered within a package is referred to as the layout style. Parts can be arranged in one of two styles: simple ordering or interleaved ordering.
With simple ordering, parts are arranged contiguously. When a package is delivered sequentially, all of the bytes for the first part arrive first, followed by all of the bytes for the second part, and so on. When such a package uses simple ordering, all of the bytes for each part are stored contiguously.
With interleaved ordering, pieces of parts are interleaved, allowing optimal performance in certain scenarios. For example, interleaved ordering improves performance for multi-media playback, where video and audio are delivered simultaneously and inline resource referencing, where a reference to an image occurs within markup.
By breaking parts into pieces and interleaving those pieces, it is possible to optimize performance while allowing easy reconstruction of the original contiguous part.
Because of the performance benefits it provides, package implementers should support interleaving in the physical package. The package implementer might handle the internal representation of interleaving differently in different physical models. Regardless of how the physical model handles interleaving, a part that is broken into multiple pieces in the physical file is considered one logical part; the pieces themselves are not parts and are not addressable.
The style in which a package and its parts are delivered by a producer or accessed by a consumer is referred to as the communication style. Communication can be based on sequential delivery of or random access to parts. The communication style used depends on the capabilities of both the pipe and the physical package format.
With sequential delivery, all of the physical bits in the package are delivered in the order they appear in the. Generally, all pipes support sequential delivery.
Random access allows consumers to request the delivery of a part out of sequential physical order. Some pipes are based on protocols that can enable random access. For example, HTTP 1.1 with byte-range support. In order to maximize performance, the package implementer should support random access in both the pipe and the physical package. In the absence of this support, consumers need to wait until the parts they need are delivered sequentially.
End of informative text.