Programming
2007-09-22
Hi All,
I decided to create this page to put in for peer review my progress and work done so far in POG scripts' automated code generation under an MDA Approach.
I'm using the AUS-based Sparx Systems' Enterprise Architect UML modeling tool. So far you already got some results of this tool like the POG manual's functions and documentation reverse-engineering under UML. BTW which UML modeling tool are you usually using (or prefer to use)?
the Architecture thread holds all related stuff about current models produced and the electronic version of the repository (in HTML).
Also, I reached a first step milestone by being able to generate automatically the POG Script comments section, the USES section, the PROVIDES section and all related PROTOTYPE Clauses.
I used as a tryout MdValley's Megatrucking script. I initially created a UML Class diagram holding a class named "Megatrucking" (see : tmegatrucking_class.pdf)
- All POG Script header infos are generated from the class info in UML.
- The USES section is generated through the UML associations drawn between the Megatrucking class and supporting classes having the customized POG Stereotype Uses defined and associated with each association link.
- The PROVIDES Section of a POG Script is generated based on the UML visibility attribute (+ or -) for each operation. A public operation is considered to be provided so it's generate the proper line of code in the script;
- The PROTOTYPE Section if filled with all operations' constructors found in the class
The result is : Upload new attachment "megatrucking.pog"
The next step I plan to do is to implement code generation of an operation body's core code through the use of an activity diagram. Using drag&drop of current POG developer's kit library of operations, it should be possible to generate as much as possible POG script by visually modeling an POG-customized activity diagram with its own set of stereotypes.
Question for GT - Does its exists some patterns in POG scripts from which we can build associated activity diagram templates ?
I've not started to think of how to implement the "task" command clause which should be done more easily through a sequence diagram. food for thoughts
Jack
James >> 23-Sep Understand the purpose of working towards a system like this, and it's very cool and a big plus once working. However bearing in mind many people will not have a commercial UML modelling tool as they do modding for a hobby, my key question is what ultra cheap, or better, free tool(s) can people use to get the benefits from PIMs and code generation?
Jasper >> 30-Sep I don't really see the point of this, pog isn't really object orientated, so is UML really appropiate? most data is stored using 'Global'. It would be useful to teach a source code crossreferencer (like lxr or Exuberant Ctags) about pog so we could have a web browserable view of the code, and to list our uses of Global and what we use them for...
James >> 1-Oct Jasper - I do not believe that UML is limited to OO systems. Equally the ability to automatically build core code structures from a set of core diagrams could be helpful as it would kick start a lot of core skeleton code using proven patterns. However that is all predicated on the tooling being there, hence my initial question. Equally source cross referencing would be valuable to. If there is a cross referencer that can be "taught" which you recommend then let me know, or are the ones you mention here the ones to go for?
Jacquelin >> 7-Oct James you're right. UML is not limited to OO modeling and also my initial intent was to set a baseline of common components to use. I made these experiments through my learning efforts of IWar2 development kit. Then, when I tried to understand and evaluate the current state of tons of POG assets' elements provided by GT, I tried to see how to recapture these aspects under a manageable perspective and eventually reuse these components later (patterns,etc.). UML modeling seemed to be a good path. Lastly, during scoping activities for Interation #1, I needed for myself to establish a high-level view of all these various modules and extensions, sketch functional relationships between features in order for me to group them in an orderly manner and still be coherent with future releases. As an software engineer , my preferred tool went naturally to UML
Having said that, source code generation is still achievable only from UML class diagrams. Sparx system's EA product is maybe the most advanced tool for that. Thus, I adapted the EA "C" language generation internal engine to generate POG instead. I<m able to generate all the headers forms of a pog script. Unfortunately, I'd hit a wall for generating others aspects (like loops, do-while, etc.). Also, POG Scripting relies heavily on functions like Task, which is best rendered through sequence diagrams... I putted aside this tread as it is not directly necessary for iteration #1.
To answer to your question James, I do not check yet if any free uml modeling tool is available. My first thought it's not the case (because of the "C" code generator engine) note a C++ source code generator engine may also do the job as well. For Jasper, you brought something totally new to me and possibly a more accessible/implementable solution to get code to work. I'll check this right away.