Subject | Re: [Firebird-Architect] BLOB Filter |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2004-06-03T07:20:32Z |
Jim,
I understand that you are very busy with Vulkan, so I repeat some
theses from my post.
I understand that you are very busy with Vulkan, so I repeat some
theses from my post.
On 2 Jun 2004 at 10:05, Jim Starkey wrote:
>>>The engine's responsibility is to store and fetch blobs, and if
>>>asked politely, find a filter to go from A to B. It was never
>>>intended that the feature would restrict usage.
>>
>> I think this approach gives user too long rope.
>>
>It's absolutely necessary. A database serving as a content store for
>a web application has to store jpeg, gifs, pngs, and who else knows
>what else. Are you suggesting that a separate table or fields are
>required for each image type? How does an application find the image
>if it only knows it's name and not it's type?
What application can do with an image of unknown type? The
application can't even request right filtering because it doesn't
know actual image type.
I know that you don't use Delphi and, I suppose, didn't dig VCL, so
I repeat. In VCL a little header is added to picture before putting
it into database. This header keeps number of images (always 1) and
type of image.
Returning to your hypothetical web application: it knows image type
before storing it into database and have to know it after retrieving
the image from database. So, DB developer declares that BLOB sub_type
-2 stays for jpeg, -3 for gif, -4 for png and so on up to N for MIME
content. (S)he also declares that BLOB sub_type -1 is for universal
(abstract) picture. And (s)he creates a table PICTURES (ID INTEGER,
NAME VARCHAR(253), CONTENT BLOB SUB_TYPE -1);
In my dreams DB and the application should interact this way:
Application has image of known type (let's jpeg). It says to
database: "this chunk of bytes is BLOB sub_type -2. Store it into
CONTENT field now!" Database (automatically) pick up filter for
transmogrification sub_type -2 (which is indicated by app) into
sub_type -1 (which is indicated in metadata by DB developer) and use
it. The filter add a header to the chunk of bytes for future
recognition of type and, say, pack it.
On retrieving of image inverse process is used.
This example may be simplier if image is always stored as MIME
stream.
>You are arguing against polymorphism. You can't win this one.
I'm arguing for strict typification. I can win this as C++ win.
SY, Dimitry Sibiryakov.