Extinfo

Status Quo

Elexis runs on a relational database. Such a database has the drawback that the Schema is relatively static and modifictions are expensive in terms of developer time and possible errors and compatibility problems.

To handle this problem and allow users and plug-in programmers to create dynamic fields, similar to a NoSQL database, ExtInfo fields have been introduced. An ExtInfo field is a BLOB from the database view and a zipped Map<String,Object> from the application view.

Problem statement

We chose a serialized and zipped Java hastable as persistence format for the ExtInfo fields. While the concept of such lightweight attributes holds still useful, this implementation proved a bad choice now: Use of such ExtInfo fields is only possible for Java Applications, since the serialized form of such Hashtables is highly Java-specific.

Possible Solution

We need a solution which maintins compatibility to existing databases and Elexis installations, but allows handling of Extinfo fields for other programs as well (JavaScript, Microsoft Access etc).

The ExtInfo Blob is really just a zip file packed in a database field. It contains onky one entry named “hash” which contains the serialized Hashtable. So, a simple solution is to just add a second entry with the same informations but in a more widely usable format: JSON. This second entry is named ‘json’.

When writing, new programs must make sure to write both entries.