Jun
12

Concepts Behind OpenG Class Templates

by Tomi Maila, Jun 12, 2007 at 10:09 am
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Yesterday the OpenG Class Template Framework together with a few OpenG class templates were released. I now try to explain shortly what these templates actually are and how do they function.

OpenG Class Templates are nearly normal LabVIEW classes that are stored under resource\OpenG\openg_object\class_templates folder under LabVIEW installation directory. To be used OpenG Class Templates require a separate tool that can create new classes from the templates and that can manipulate existing classes created from class templates.

The class file of LabVIEW classes is always an XML file with information of class properties, class private data and class item properties. OpenG Class Templates differ from regular LabVIEW classes in that additional information is added to the lvclass XML file of the templates. This additional information explains the template tool such as Endevo GOOP Development Suite how to work with the templates. Based on this additional information the template tool knows how to create new classed based on the templates, how to create new methods from method templates, how to rename class based on a template and how to update template changes to template based classes.

When user wants to create a new class that is based on a OpenG class template, he needs to do this via a tool that support OpenG class templates. In the process, the tool creates a copy of the template and manipulates the copy according to the template meta data written in the template XML file. The tool also adds additional attributes to the class file created from the template so that this class can be recongnized to be based on a tempalte and the template used can be located. When there are changes in the template, these changes can be applied to the classes based on the template using this metadata in the class files.

As the templates are more or less regular LabVIEW classes, they can also depdend on other templates in a very similar manner as LabVIEW classes inherit from parent classes. For example OpenG Active Object Template is based on OpenG Reference Object Template. Active object is actually a referece object with some extra features and with a few changes in some underlying mechanisms. The inter-template dependency means that changes to parent templates can propagate via the child templates to classes created from the templates. This of course requires support from the tool being used.

The tools that support OpenG Class Template specification should be able to recognize any template in the above mentioned template directory. This makes it possible for the developers to create their own class templates specific to their own needs. However OpenG Class Template specifications are quite complex yet capable and it is not very easy to create new class templates. The complexity of the template mechanism also means that it’s probable that in the beginning only tested templates will work with tools supporting OpenG Class Templates and actually the support for custom templates will see light only when the tools get more mature.

Print This Post Print This Post

No Comments

Make A Comment

No comments yet.

Comments RSS Feed   TrackBack URL

Leave a comment