Visual Studio Integration Update

Things are moving along quite nicely. Something our users will greatly appreciate is that in the process of developing our full Visual Studio support we have created what are essentially project files (recalls the settings of each template you execute automatically). An embedded My2ndGeneration Visual Studio template doesn’t contain the actual template, rather it contains all of the information required to execute a particular template

Let’s take a look at how this all works:

Enabling Support for Visual Studio

There is a new menu option that will allow you to enable Visual Studio support for VS2010, VS2012, VS2013 and all future versions.

B1

Once you click on the VS Support icon (shown above in the red circle) you will be presented with the dialog above. You can pick and choose which instances of Visual Studio you want to add (or remove) My2ndGeneration support to.

Once Inside Visual Studio

After you have enabled My2ndGeneration support for Visual Studio you can launch the My2ndGeneration Desktop as a Visual Studio AddIn via the Visual Studio “Tools” menu (shown below).

B2

My2ndGeneration can run as a stand alone desktop application or as a Visual Studio AddIn. If you enable Visual Studio support you can still run the My2ndGeneration Desktop as a stand alone application. Shown below is My2ndGeneration running inside of Visual Studio 2013.

B3

Of course this is all pretty cool. If you’re using My2ndGeneration within Visual Studio you don’t have to switch applications, but we’re just getting started.

My2ndGeneration Visual Studio Templates

When you want to add a My2ndGeneration embedded template to your project you use the same approach as adding a new file. You right mouse on your project, choose “Add” then “New Item” and you will see “My2ndGeneration Template” as an option.

B4

This will create a new file with the .M2G extension to your solution with the “Custom Tool” already hooked up for you (shown below). We can see this by looking at the properties of our “Tempate1.M2G” file.

B5

Notice that Visual Studio sees our Template1.M2G as a JavaScript or JSON file, you can tell this by looking at the icon for the Template1.M2G file in the project file above. This is by design and was configured this way when we enabled support for Visual Studio as shown in the first image at the top of this blog post.

Where it All Pays Off

What is in this Template1.M2G file? Everything that is needed to execute a given template. This data is in JSON format (as shown in image below). There are two awesome benefits here.

  • We have the ability to record these settings when you run any template. Then all you need to do is copy the recorded output into your Tempate1.M2G file and it will execute the template as desired.
  • Because we record the results of every template execution we can automatically pre-select your last settings for you whenever you execute a template using the cloud or desktop versions. This will save you a ton of time when you need to regenerate your artifacts, whatever they may be.

B6

Finally, the Code Generation Itself.

Anytime you edit and save a .M2G file the template will be executed. This means you can open a template, add a new table to the “Tables” list, hit save, and it’s automatically regenerated. Of course, at any time you can execute it by using your right mouse to invoke the “Run Custom Tool” option. See the image below showing the results of executing the above template.

B7

Notice that the My2ndGeneration AddIn generated the Employees and Orders classes just as we have directed it to in our Template1.M2G template.This all gets checked into your source control system and your entire development team now benefits.

When will it be released?

This is a significant release that will require a lot of testing. Anytime you start writing complex visual studio extensions testing become paramount. Also, we have enhanced the metadata to include information about the template itself in order to be able to generate these many project files. Thus, we need to retro-fit these changes back into the My2ndGeneration cloud version as we always keep the desktop and cloud version in-sync so that templates always execute correctly whether they be in the cloud or on the desktop.

If you’re interested in a beta version of this release email us at support@my2ndgeneration.com and let us know. We are looking at a March 23rd release date for the beta (possibly sooner) and we expect the final release to follow on shortly as we will have done a lot of internal testing before the beta release.

M2GLOGO

Advertisements
Posted in My2ndGeneration Desktop, 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: