In my last posting, the question was indirectly raised as to what I was talking about when I said “dynamic programming”. With our approach here at Alagad, dynamic programming means taking a very generic set of constructs and then applying metadata to them to make them useful.
For example, in our generic object management system, there is the concept of a “object” service layer and business object as well as a generic object data tier. By itself, all of this code is fairly useless. The key is the metadata that describes the “objects” within the current application. Thus, we take a very generic set of code, apply application specific metadata, and voila! we have application specific coding without really doing any new coding that needs testing etc.
For an example that more people would be familiar with, take your favorite ColdFusion framework … Model Glue, Mach-II, Fusebox, etc. By themselves, all of the code within these frameworks is useless until you add a configuration file describing the different events, controllers, and views that your application will handle. With the addition of this configuration file, you now have a very application specific code base without really writing much code.
So now that we have this generic set of code, how do we describe the intent of our current application metadata? There are quite a few possibilities out there, but the two that I have seen used most often are XML and actual code. Other options could include simple configuration files (csv, ini, etc), larger scale content management systems and a variety of other custom solutions that could go as far as writing your own language and associated parser.
One example of using code to describe your metadata is the FarCry content management system. It has been a while since I looked at FarCry, so excuse me if some of my terminology is not up to date. With FarCry, when you want to add a new property or data element to your content management system, you create an empty ColdFusion cfc which contains a series of tags. The FarCry core will then read these cfc files, interpret the tags and make the new data type available within the content management system. Now does not have the necessary attributes available out of the box, so FarCry makes use of a whole series of custom attributes on the tag. I believe you can also add custom functionality using <cffunctions within the cfc, but it has been a while.
On the plus side, this method of providing metadata to the FarCry core is easy for ColdFusion developers to understand as it is written in ColdFusion which we are all used to. At the same time though, this can be a minus if you were to have your business analyst drawing up the requirements for the system instead of using your development team.
When we developed our internal object management system, we made the choice to go with XML for the metadata. By going with XML, you literally have unlimited possibilities in what information you want to collect and how you want to represent it. As long as you stay within the syntax rules of XML, you can write your own language and through the use of a DTD or Schema, validate that whomever created a given XML document followed your language. By going this route, business users or analysts can easily create and provide for you the metadata needed for your system by just knowing the syntax of your language rather than requiring them to know about cfcs and tags. How much of a benefit to you this is obviously depends upon your situation.
So, are there other examples of metadata formatting and structure out there that you have seen or prefer?