Multimedia_text objects

Multimedia_text objects

The first object we meet is called multimedia_text. It is our main storage unit. It can contain any length of UTF-8 text (yes, any really means any) but it can also have no text at all and in instead point to an executable file object.

This is an important feature, because it means that content can indifferently be in textual, pictorial, audio or video format and the system will treat it anyway for what it is: a piece of content.

What we do with textual content is quite ordinary: we store it as compressed text, so it won't eat up your disk when it's millions of content parts you are hosting, we decompress it and serve it.

Life with files is more complicated, as there is no warranty that when a user receives from the network a video content part he/she is also willing to spend bandwidth to download what potentially amounts to gigabytes.

So we do not store the file in this object, we simply keep a pointer to a file list that will give us a receipt to obtain the actual file, if the user really wants to have it.

Wait a minute! How can we tell in what language this content part is? Or in what script? Well, the multimedia_text doesn't know anything about it. Its mission is to store things and this is what it does. So how do we do it?

Here is where inheritance comes handy. A multimedia_text is built on top of an object called object. You can think of it as of something encapsulated into multimedia_text, like the engine in a car. You don't actually see it, but it's there and it does loads of useful things. All answers on how multimedia_text gets to know more about itself lay in what object does, as we shall see in the next chapter.