next up previous contents
Next: Plug-in architecture Up: Indexing Module Previous: Indexing Module   Contents

framework

The indexing framework has been altered quite a bit according to test results obtained during development and the incorporation of a plug-in architecture. These recurrent alterations resulted in a final framework that has as small a codebase as possible. Basically the framework consists of two routines. The first routine is run every time the indexing module is loaded and deals with identifying available plug-ins. The second routine consists of a loop where plug-ins are loaded upon use.

The main challenge in designing such a system is finding a reasonable tradeoff between system speed and plug-in utilization. This resulted in a dynamic and - somewhat - intelligent system, where plug-ins are added to the database during the discovery phase as if they were data items. The only difference lies in the identifying tag. Adding an item into the hierarchy at subtree X implies that plug-ins registered at X or at ancestor nodes can find extra information. These plug-ins are called successively, each rewriting the data in the hierarchy. This recursive process stops when no more useful plug-ins are found. To start this process we have to bootstrap the system. Bootstrapping is done by adding a plug-in to the root of the hierarchy. Any data item added to the tree is part of the hierarchy, resulting in the calling of this plug-in. It is elementary that this plug-in should be as general as possible. I've therefore created a plug-in that reads filesystem information only.

I'll illustrate the indexing process with a simple example. Let us consider a .mp3 audio file. The bootstrapping plug-in creates an entry in the filesystem subtree. This activates the content sniffing plug-in that adds an entry in the audio/mpeg subtree. Since we have an mp3 specific plug-in that is registered under this subtree this plug-in will then be called. Another plug-in may then be called using the information obtained during the mp3 specific process. Etcetera.

A problem that may occur with this recursive process is that a loop in the data flow can be created. This problem has not been dealt with explicitly in the testprogram, since too few plug-ins currently exist to create such a loop. Please note that it should of course be dealt with in real life products where more plug-ins are used.


next up previous contents
Next: Plug-in architecture Up: Indexing Module Previous: Indexing Module   Contents
2002-08-28