Document System

The document system is a set of strategies that allows Black Fennec to be completely independent of the underlying file types. It is a set of interfaces that allow Black Fennec to read and write files in a generic way. The document system is also responsible for the file type detection and the file type association.

The overall interaction of the different components involved is visualized in the following diagram:

../../../_images/aa97d639d2b79e3e29c3acb9f7ec4b9cb70f1f12c64b4627a20882eed7340c69.svg

Document

A document is a file that can be opened by Black Fennec. It is a set of data that can be read and written by Black Fennec. A document is traditionally a representation of a file. It leverages the Resource Type and Mime Type strategy patterns to load and parse arbitrary file types from arbitrary sources. A document can easily be created via the Document Factory.

Document Factory

The Document Factory is a factory that creates Document instances. It can be responsible for the resource/mime type detection and does the resource/mime type lookup in the Resource Type Registry/Mime Type Registry. These Registries are to be dependency injected upon creation of the Document Factory.