How CodeStencil Works

CodeStencil is simply an IDE that helps you intelligently use an existing codebase to build a stencil (stencils are similar to templates) that can be used to generate structured code.

CodeStencil stores fragments of text is a tree-like structure ( See Code Tree ). This stored text can contain Expansion Labels ( similar to variables) which can be replaced with pre-defined strings during code generation.  The process of code generation starts from the root node in the Code Tree and goes all the way down to the last node.

There are 2 types of Expansion labels - Expanders and Code Nanites

 

Expanders 
If you want to insert a string (during code generation) representing your namespace, all you need to do is define the Expansion String and the replacement text in the Expander panel.
From the screenshot, NAMESPACE will be replaced by "Dolasoft" during code generation. You can even combine Expanders, for example, a construct like: [%ORGANIZATION_LABEL%].[%PROJECT_NAME%] will expand to a string like:MicroSoft.MyProject
Code Nanites -  Code Nanites are blocks of code that can be executed when encountered during code generation.
For example, this code nanite -  CS_TABLE_LIST when combined with ".cs" create a list of files based on table names in the Schema. 
Image
Image

Unlike standard code generators, you do not need to learn a template language. If you do not want to build your stencil from scratch, you can create it within minutes from already generated code (See how, here). 

For example, if you want to insert a string (during code generation) representing your namespace, all you need to do is define the Expansion String and the replacement text in the Expander panel.

Expansion labels are defined inside Expanders.

Code Generation with CodeStencil is an easy process that does not require learning a new templating language.

 CodeStencil

 

How Stencils work

Generating a working app is very easy so long as there is a custom stencil. Developers have the flexibility of creating stencils for any language/environment, the only requirement being basic knowledge of C#.

1. Create a new Project

Create a new CodeStencil project by selecting an existing Stencil, e.g. the DevEx Grid Stencil.

2. Import a DB Schema from an existing database
3. Configure if necessary
4. Generate your code
5. Run the application
Image
© 2018-2020 CodeStencil - Zera Systems Inc. All Rights Reserved.

No items in cart