Ad-Hoc Data Serialisation Formats

I’ve been doing a bit of tidying up of the code that goes into the Navigation plug-in for Haddock CMS. An enhancement that I think is quite necessary is to have navigation lists saved in files under version control rather than in DB tables. This makes testing and collaboration much simpler.

The question that any CS student will ask himself is “What format should I use?” I’ve used XML a lot in different parts of Haddock CMS and it is certainly more than expressive enough to be able to store the data for simple navigation lists.

However, it seems like overkill.

Also, I might want to allow users to be able to edit the navigation list specification files in the admin navigation back end.

A simple whitespace delimited data serialisation format springs to mind. This wouldn’t be too difficult to define or implement and I think that users could understand it without too much difficulty.

I started to imagine this language and wrote out a few examples. I started to think about the grammar of the language in BNF. This is definitely an area of programming where the test first approach is very sensible.

It seems that web programmers are very fond of text files and formal languages. I started to wonder about whether there is a version of YACC for PHP and whether such a beast would be a good idea or not.

2 thoughts on “Ad-Hoc Data Serialisation Formats

  1. Robert Impey May 15, 2008 / 8:37 am

    SQLite is probably the solution that I am going to use.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s