M2G’s Revolutionary Approach

The next release of the My2ndGeneration Desktop about is about to change the concept of Templating within Visual Studio forever. And from here, the sky’s the limit. We are talking to some of the online IDE developers about building this technology into their browser based IDE’s which is a perfect fit with our cloud based generator.

So, What is this Revolution?

Take a look at the snap shot below and you will notice several key components:

  • In the left panel is the My2ndGeneration Desktop running inside Visual Studio.
  • In the Solution notice the Tiraggo.M2G file. This file has a “Custom Tool” associated with it called “My2ndGenerationGenerator” that produces the output by executing the desired template. This is akin to a T4 template only rather than containing the template it describes the template it wants to execute with the desired input.
  • The Tiraggo.M2G contents are also shown in the top right panel. All “.M2G” files use Javascript formatting as does any typical JavaScript file. There is even a template that can generate your M2G file for you!

M2G_VS_Integration

Why is the My2ndGeneration Approach Superior to T4?

The My2ndGeneration Desktop is already runs within Visual Studio. However that in itself is not the revolutionary part although it is nice to be able run the My2ndGeneration Desktop inside Visual Studio or as a stand alone executable.

No, the revolutionary part is going to be the displacement of T4 as the templating engine of choice, and I’m not sure T4 was really anyone’s preferred choice.

  • T4 Templates are extremely hard to write, understand, and maintain.
  • T4 Templates require on average 20 to 100 times more code than a M2G template.
  • T4 Templates look nothing like the output they are trying to create.
  • T4 Templates are dangerous in that a T4 template has full access to your machine.
  • T4 Templates are not actually templates but C# programs masquerading as templates.
The My2ndGeneration Advantage

My2ndGeneration templates look much more like the actual output than they do templates and they are based on Handlbars.js which is the most popular templating engine.My2ndGeneration allows for full JavaScript execution on the Desktop and since Handlebars.js is “logicless” is cannot reach out and touch your machine in any way whatsoever. There is no chance of a My2ndGeneration template ever harming your computer. My2ndGeneration provides full low level database schema information to EDMX based templates whereas T4 hides this information from the developer. My2ndGeneration can use your database schema, user provided JSON, and even EDMX files as it source of input. We will also soon be allowing as input to templates direct queries against NoSQL databases like MongoDB which are JSON based.

Finally, there is a My2ndGeneration cloud based version where templates are published and shared among the My2ndGeneration community. With your free My2ndGeneration account you work in repositories and can collaborate with other developers and even grant them collaborator access to your repositories. There is even a tiny metadata client that runs on Windows, Linux, and the Mac that will push your metadata up to the cloud. My2ndGeneration is in no way Windows only technology.

What does a typical M2G Template look like?

A typical My2ndGeneration template looks like the sample below. This one happens to create a simple POCO. The “Items” collection that we are looping over contains a list of tables and the associated metadata for all of the associated database objects like columns, foreign keys, primary keys and so on ..

Compare the simplicity of this My2ndGeneration template to one of your T4 Templates.

M2G_Typical

The template above produces the output below for every table selected.
Each in it’s separate file.

public class Employees
{
    public int? EmployeeID { get; set; }
    public string LastName { get; set; }
    public string FirstName { get; set; }
    public DateTime? BirthDate { get; set; }
    public DateTime? HireDate { get; set; }
    public byte[] Photo { get; set; }
    public int? ReportsTo { get; set; }
    // and so on …
}

The best part about the My2ndGeneration Desktop is that you can create templates via drag drop. Any templates that executes in the cloud will also execute on the Desktop.

Sign up for for Free Account and get started today …


M2G_image

Advertisements
Posted in My2ndGeneration Client, My2ndGeneration Desktop, Templates, Visual Studio Integration

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Twitter

Enter your email address to follow this blog and receive notifications of new posts by email.

%d bloggers like this: