![]() |
![]() |
| Gen X | ||||||
![]() Gen X is a very simple yet sophisticated way to capture code you’ve written into templates and easily reuse it from project to project. Gen X is NOT a methodology, CASE tool, or classic code generator. With Gen X, you do not have to learn proprietary syntax, and you’ll be using technology you already have! Essentially, Develop Mentor wanted to create a simple way to generate code from metadata using the stuff you’ve already got installed and without your having to learn anything really new. Once you are familiar with Gen X, your computer will handle many repetitive coding tasks and you’ll be free to solve new problems. Gen X integrates with Visual C++While Gen X at its heart generates any form of code or text, the current version provides integration with the Visual C++ IDE. Now let's take a look at how Gen X works... Back to the TopX-Code does itWhat is X-Code?At the heart of Gen X is what we call X-Code. X-Code is the way we combine changing input variables with static code. X-Code has an engine that does the merging at runtime and a syntax that you'll use to declare the variables when making a template. The X-Code syntax is virtually an exact match to ASP (Active Server Pages). If you know ASP, there's nothing new to learn. (X-Code is like ASP in syntax only and does not require a web server to run.) Below is a diagram of the process: Code is written with variables described between <%%> using X-Code syntax.![]() Variables are then supplied separately from another file. In this example, it is a simple text file.![]() At runtime, the X-Code engine merges the code template with the variables and produces the following result:![]() X-Code is based on Active ScriptingVariables do not usually originate in text files. Because X-Code uses an Active Scripting Engine, you can use any form of data that can be read by a COM object. We refer to this as "metadata" and using metadata opens up a host of possiblities... The key is metadata... But before going further, pause here and let your imagination run wild on the possibilities! These suggestions should help:
Real ScriptingNow, about that Active Scripting EngineGen X does NOT run on a proprietary variable substitution engine. If you use Visual C++, you already have VBScript or JScript. Gen X harnesses your hosted scripting environment so you can program against it and do things such as access COM objects, create custom data structures, and write subroutines. The scripting language you wish to use is easily declared in your template file in what is called a language block: <%@ language=VBScript %> Before you see one of our favorite applications of Gen X, this is a most excellent place to pause and really think about the possibilities the scripting environment provides! These suggestions should help:
More Motivation for Gen XNow let's look at one of our favorite applications of Gen X! If you write code used by others, you want to make things easy for them and to reduce questions coming back your way. You'll also want them to understand your code and to be consistent with their implementation. This very common situation is exactly why we included the ability to build handy Wizard dialogs to accompany your template source files... Back to the TopGen X Wizards(We know you're not fond of wizards, but read on.)The familiarity of the wizard interface will make things easy for the developer receiving your code. But don't be fooled by a familiar face, Gen X Wizards are very different from traditional wizards! It's not all about wizardsBefore we show you how easy they are, remember Gen X is not about wizards, but about code generalization. It is about setting up your code in template form to be easily reused with supplied metadata. That is why Gen X also provides a command line interface to the X-Code engine. ![]() Since we're not going to cover the command line interface again on this tour of Gen X, this is another great place to pause and consider the possibilities of what you can do. The command line interface is one of several ways Gen X allows you to generate code in any language. Some of the ways we use Gen X at DevelopMentor should provide some good suggestions:
Building WizardsNow let's take a look at building a Gen X Wizard to accompany your template code and why they're unlike other wizards. Structure of Gen X WizardsWith Gen X you can build wizards to create new projects (ProjectWizards) and wizards to add code to existing projects (FeatureWizards). A Gen X Wizard creates the following directory:
![]() Gen X Authoring ToolsBuilding Gen X Wizards for your template code is easy with the supplied tools:
As you'll see, Gen X Wizards do not have the same limitations that frustrate every developer when they use a wizard. Now let's start to see why... Back to the TopEditing WizardsEdit any Wizard! ![]() The Wizard Manager ![]() HTML Dialog Editor HDE in Edit Dialog View ![]() HDE in Edit HTML View ![]() RewizardingYou can change your mind!Not only are Gen X Wizards editable, but you can also rewizard them. This means that *AFTER* you run a Gen X Wizard and begin working with the code, you can change your mind. Yes, you read that correctly. You can re-run Gen X Wizards with different options and not lose changes you've made. Gen X Rewizard Button in the Visual C++ IDE: ![]() You can change your mind!Keep your changes Wow, Gen X Wizards really ARE different!Let's think about the implications of using Gen X Wizards to distribute your code. You write code that others use. You can now easily put your code into a template with a wizard to go with it. The developer you send it to doesn't have to decipher your code per se, but can instead run the Gen X Wizard you've provided, entering the appropriate values for the wizard variables. A wizard dialog combined with appropriate comments in the code creates a foolproof set of instructions about using your code. This greatly shortens development time on the receiving end of your code. And it means that each implementation will be consistent and may also reduce any QA and support headaches as a result. Gen X Wizards can be debugged ![]() Favorite WizardsNew Life for Microsoft Wizards ![]() ![]() If you've been imagining the possibilities throughout this tour, you'll no doubt have hit on ways to use Gen X that have nothing to do with writing C++ code or with using wizards. And you are probably thinking about generalizing your code into templates and about automating the reuse of the code you painstakingly write. Back to the Top Search HALLoGRAM || Request More Information CALL TOLL FREE 1-866-340-3404 |
|
|||||
| Copyright
©2002 HALLoGRAM Publishing, Aurora CO. All Rights Reserved All products mentioned in this site are trademarks of their respective owners Prices are subject to change without notice caksgkim | ||||||