Dashboard > Hippo Open Source projects > ... > Design solutions > Managed Binary Field
Managed Binary Field
Added by Johan Stuyts, last edited by Johan Stuyts on Aug 15, 2006  (view change)
Labels: 
(None)


Managed Binary Field - Persistence

Full text

Intent

Provide transparent storage of unstructured binary fields containing information created using the application instead of containing imported data.

Also known as

Input Stream Factory

Motivation

Some database applications have to store unstructured binary data. This data is always handled as a single unit by the business logic, and the business logic performs no or very little processing of the data. Some examples are XML documents and images.

What data type should the field have? The obvious choices are an array of bytes and an input stream. Both of these solutions have issues.

Using an array of bytes requires that the complete binary object is kept in memory. This could cause memory problems for server applications that need to handle many requests that have to process binary objects.

Using an input stream prevents having to load the data into memory, but introduces other problems. An input stream can only be used by a single thread, and, depending on the implementation of the stream, the input stream might only be usable once, i.e. it is not possible to seek to the beginning of the stream.

By using an Abstract Factory as the field type, the issues of byte arrays and input streams are resolved. The data no longer needs to be in memory completely, and the data can be accessed multiple times, by multiple threads simultaneously.

Implementations

Participant Environments Project
InputStreamFactory - hippo:general
ConcreteInputStreamFactory File, BLOB, JPOX hippo:general
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.7 Build:#813 Aug 28, 2007) - Bug/feature request - Contact Administrators