| By Patrick Gannon | Article Rating: |
|
| January 8, 2006 04:45 PM EST | Reads: |
11,955 |
Creative Modeler is a full-featured diagramming environment that can be extended to create any type of diagram. It includes a data translation engine that facilitates the editing and conversion of data in any structured file format into any other structured file format (XML or non-XML). The automation API is based on .NET and XML/XSL. This article will discuss how Creative Modeler can be used to edit arbitrary data in a visual format.
Data Translation
The data translation engine built into Creative Modeler supports converting data from source (non-XML) formats into XML formats, and back again. It also supports converting XML formats into other XML formats via XSLT (Extensible Stylesheet Language Transformations). To convert non-XML into XML, users create a grammar file, in a variant of Chomsky normal form (for more information on the Chomsky normal form, refer to the Wikipedia: http://en.wikipedia.org/wiki/Chomsky_normal_form). In a Chomsky normal form, grammars have a start (or root) symbol, which refers to two other symbols (either as a sequence, or a choice - a logical "and" and "or," respectively). Those symbols may refer to other symbols, or they may be terminal (or leaf) symbols (such as a constant). Creative Modeler extends this concept by adding the notion of variable symbols (for capturing data), along with a number of other conveniences. Grammars are specified in a new XML format (a ".cmgrammar" file). This approach is used to convert C# source code and T/SQL table scripts into XML. In addition, any structured data format can be converted into XML, using this approach (see Listing 1).
Once converted to the appropriate XML format, the data can be visually edited in the diagramming environment. After editing the data in one or more diagrams, the user can generate the source data with the changes. This functionality utilizes a user-provided XSL file. Additionally, a command-line tool and .NET automation class are provided to allow transformations to occur outside of the diagramming environment.
Case Study: Web Application Framework
To illustrate how Creative Modeler can be utilized in a business scenario, consider a Web application framework that is used internally by one of Microsoft's top consulting partners. This framework allows consultants to quickly create data-driven forms, complete with validation, navigation, declarative business rules processing, and much more.
The framework has seven types of interrelated XML files that consultants create to form the foundation of a data-driven Web site. The file types are Business, Data Action, Data Location, Form, Menu, Mode, and Process. The following relationships exist between the file types:
- Process files refer to multiple Business files
- Business files refer to a Data Action file
- Form files refer to multiple Business files
- Form files may refer to another Form file
- Form files refer to a Mode file
Implementation
To implement a solution such as the one described for the Web application framework, a developer creates a set of XML files and .NET classes that are collectively referred to as a "profile." An empty profile is created by clicking on the button resembling an asterisk in Creative Modeler and entering a name. Creative Modeler creates a new directory structure and a ".cmprofile" XML file where deployment details are specified (more on deployment later). Afterwards, the developer edits the configuration file that was also generated (configuration.xml) to specify the details of the profile, including the types of artifacts to edit.
Artifacts are the data objects that are modeled in Creative Modeler, which in the case of the Web application framework, correspond to a single, unique file type. As such, the artifact types would be Business, Data Action, Data Location, Form, Menu, Mode, and Process. In general, Creative Modeler also supports file types that contain multiple artifacts. For each artifact, the developer creates a .NET class, inheriting from "SDA.ArtifactModel." Each field and property in the artifact class that will be edited graphically is annotated with the "SDA.Editable" attribute, which takes arguments that specify details about the .NET WinForms class that will be used to edit the field value in the property window. If an area larger than 20 pixels high is needed to edit the value (the control will be instantiated in a grid format), then the Editable attribute refers to a control containing a button that activates a new window for more sophisticated editing (see Figure 1).
The configuration file also contains information about the interface symbols that are to be used to represent the artifacts in a diagram. A .NET WinForms control is created for each symbol, which inherits from "SDA.SymbolControl," or alternately, implements the "SDA.ISymbol" interface. New symbol/artifact pairs are created at run time using the Creative Modeler toolbox, and then are dragged around, resized, edited, or deleted in the diagram. The symbols have references to their corresponding artifact instance, so changes can be made to the model by listening to the click event in part of the control. One could, for example, have a check box within his or her symbol control that toggled a Boolean field in the artifact. More detailed editing would be accomplished through the property window (which is invoked at run time by right-clicking on a symbol in the diagram).
Next, the types of relationships that exist between the artifacts are specified in configuration.xml. For generic "Boolean-type" relationships (where the relationship has no custom properties), a predefined relationship (like "SDA.AssociationRelationship") can be used. If the relationship has custom properties (as is the case with the relationships that exist between Process artifacts and Business artifacts), the developer creates a .NET class that inherits from "SDA.Relationship," which contains the custom fields and properties (annotated with the "Editable" attribute, in the same manner as when creating artifact classes), as well as the method for rendering the relationship in the diagram. The predefined relationships (such as "SDA.AssociationRelationship") can be extended to eliminate the need to render the relationship's "arrow."
The data transformations that are used to import and export artifacts to and from data are also specified in configuration.xml. Each file type represents a language and is recognized by its file extension. Within a language, details are specified about what translations occur upon importing and exporting. There are two built-in translation types: "SourceTransform" and "XslTransform." The "Source-Transform" translation converts source-data (non-XML) to XML, using a grammar. The "XslTransform" translation converts XML data to another XML format, or to a source-data format, using an XSLT file. Custom translations can be declared as well, which involves writing a .NET class that inherits from the "SDA.Translator" class (see Figure 2).
configuration.xml also contains information about which diagram types are available, and what symbols are allowed in them. Last, it contains information about the structure of the "artifact tree" (which organizes artifacts hierarchically in the Creative Modeler interface) and the commands that can be invoked from it (which correspond to .NET classes that implement the "SDA.ICommand" interface, or optionally to the "SDA.ILongCommand" interface to make use of the progress window).
Deployment
Creative Modeler comes in two editions: Architect and Business. The Architect edition is geared toward the developers who create and maintain the profile or profiles. The Business edition is designed for business users who make use of a profile. In other words, the Architect edition users configure the Creative Modeler implementation, which Business edition users leverage to create diagrams and import and export data. The profile (Creative Modeler implementation) contains a ".cmprofile" file, which specifies the deployment targets. When a new version of the profile is available, it is deployed to Business edition users by an Architect edition user, using functionality that is built in to Creative Modeler.
UML and E/R Support
Creative Modeler has built-in support for creating UML diagrams, as well as importing and exporting to and from C#. Inheritance and aggregation relationships expressed in code are added to the diagram automatically when both classes involved in the relationship are added to a diagram. A subset of T/SQL is also supported for creating Entity-Relationship (E/R) diagrams. Similar to the class diagram, foreign key relationships expressed in the script are added to a database diagram when both tables are added to the diagram (see Figure 3).
Conclusion
Given how Creative Modeler has the capability to translate and edit any structured data, it is easy to see how businesses can leverage the technology to enable their developers and business users to easily create and modify a wide variety of system artifacts. Workflows, configuration files, and proprietary scripts (and much more) can all be easily round-trip engineered using Creative Modeler. If you have an application that requires significant customization, this is the software for you.
CREATIVE MODELER IS ©2005 PATRICK GANNON, AND HAS A PATENT PENDING.
Published January 8, 2006 Reads 11,955
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Patrick Gannon
Patrick Gannon is the president of Creative Metasoft in San Francisco, CA. For more information, code samples, or an evaluation copy of Creative Modeler, visit www.creativemodeler.com or e-mail pat@creativemodeler.com.
![]() |
news desk 01/08/06 06:03:51 PM EST | |||
Creative Modeler is a full-featured diagramming environment that can be extended to create any type of diagram. It includes a data translation engine that facilitates the editing and conversion of data in any structured file format into any other structured file format (XML or non-XML). The automation API is based on .NET and XML/XSL. This article will discuss how Creative Modeler can be used to edit arbitrary data in a visual format. |
||||
![]() |
XML News Desk 01/08/06 04:43:24 PM EST | |||
Creative Modeler is a full-featured diagramming environment that can be extended to create any type of diagram. It includes a data translation engine that facilitates the editing and conversion of data in any structured file format into any other structured file format (XML or non-XML). The automation API is based on .NET and XML/XSL. This article will discuss how Creative Modeler can be used to edit arbitrary data in a visual format. |
||||
- Kindle 2 vs Nook
- Practical Approaches for Optimizing Website Performance
- SQL Anywhere Server and AJAX
- PowerBuilder Top Feature Picks
- The Difference Between Web Hosting and Cloud Computing
- PowerBuilder 12 and .NET
- Contrary Opinion: Why Silverlight is Good for Adobe
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Cloud Computing Best Practices
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Rich Content Rotator for ASP.NET
- RIAs for Web 3.0 Using the Microsoft Platform
- Kindle 2 vs Nook
- Practical Approaches for Optimizing Website Performance
- Social Media Terrorists
- SQL Anywhere Server and AJAX
- SYS-CON's Cloud Expo Adds Two New Tracks
- PowerBuilder Top Feature Picks
- The Difference Between Web Hosting and Cloud Computing
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#


































