Tuesday, August 12, 2008

Meta-Programming as a Model Creation Technique

Model-Driven Programming and Meta-Programming together with Semantic Web and End-User Programming techniques are vital ingredients of the User Driven Programming/Modelling approach used in this thesis. Dmitriev (2006) explains the problem to be solved in order to improve model production as “limitations of programming which force the programmer to think like the computer rather than having the computer think more like the programmer.” Meta-programming (Dmitriev, 2006) is a useful way of allowing for language independent software development, and can aid in providing a high level front-end to programming languages. “Meta-programming is the writing of programs that write or manipulate other programs (or themselves) as their data” (Wikipedia, 2008).

The idea behind use of meta-programming in this thesis is that instead of writing programs to do a task a domain expert needs the program for, the meta program developer creates an environment which all domain experts, in this and similar fields can use to create their own solutions. The developer then only needs to maintain and improve this programming environment, and can concentrate on this task; the domain expert can concentrate on solving the problem at hand without having to ask the developer to create the code on his or her behalf. Dmitriev (2006) advocates reducing dependency on languages and environments by enabling programmers to develop their own specific languages for solving each domain problem:

"If we are going to make creating languages easy, we need to separate the representation and storage of the program from the program itself. We should store programs directly as a structured graph, since this allows us to make any extensions we like to the language. Sometimes, we wouldn't even need to consider text storage at all. A good example of this today is an Excel spreadsheet. Ninety-nine percent of people don't need to deal with the stored format at all, and there are always import and export features when the issue comes up. The only real reason we use text today is because we don't have any better editors than text editors. But we can change this... Text editors... don't know how to work with the underlying graph structure of programs. But with the right tools, the editor could work directly with the graph structure, and give us freedom to use any visual representation we like in the editor. We could render the program as text, tables, diagrams, trees, or anything else. We could even use different representations for different purposes, e.g. a graphical representation for viewing, and a textual representation for editing. We could use domain specific representations for different parts of the code, e.g. graphical math symbols for math formulas, graphic charts for charts, rows and columns for spreadsheets, etc. We could use the most appropriate representation for the problem domain, which might be text, but is not limited to text. The best representation depends on how we think about the problem domain. This flexibility of representation would also enable us to make our editors more powerful than ever, since different representations could have specialized ways to edit them."

This provides a way to create programs that create programs so enabling the 3 step translation process used in this thesis, and this enables translations between people, between systems, and between languages. This could enable those who are not currently programmers to create models at their domain level using domain specific systems created for them by programmers. The mechanisms for this are recursive translation of the tree/graph code representation to multiple models and languages, where necessary aided by user/modeller choices.

References

Dmitriev, S., 2007. Language Oriented Programming: The Next Programming Paradigm - http://www.onboard.jetbrains.com/is1/articles/04/10/lop/.

Fischer, G., 2007. 'Meta-Design: A Conceptual Framework for End-User Software Engineering' http://drops.dagstuhl.de/opus/frontdoor.php?source_opus=1087 - Dagstuhl Seminar Proceedings.

Wikipedia (2008) Metaprogramming - http://en.wikipedia.org/wiki/Metaprogramming.

More information is available at - http://www.cems.uwe.ac.uk/amrc/seeds/softwareengineering.htm#MetaProgramming.

No comments: