Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Reality Check?
 

Reality Check?

First I want to apologize for the long post.

Ok. I will admit that I am just entering into the whole GAT arena so my question might be absurd. If so I apologize. I am Architect for a development company that is embarking on a web app that will involve over 200+ pages. And as with ALL projects, we do not have enough time or people.

I have been recently dividing my thoughts into 2 areas for this initiative. Reuse & Repeat.

Reuse - This is from my classical OO background. Areas where the functionality is shared we will develop the appropriate assets (i.e. Custom Components, user controls, master pages, etc.) This part is under control. However it is the new one I would appreciate some feedback on.

Repeat - There are several "patterns", if you will (not to be confused with GoF), in our web page specifications related to layout & "user experience". Although certain reusable assets exists within these there is an element of a repeat scenario that I am thinking GAT might help with.

My theory is to use the GAT to create various recipes that will accelerate these repeatable tasks. For example, we have a predictable layout for single record manipulation. If we can use a combination of T4s, actions, custom wizard pages and such I want to take the "first" cut at creating the aspx AND code behind class for the developer. This gives us several things: 1) the coder a head start 2) me a chance to have them use the 'reusable' pieces (via generated code)as much as possible 3) Set some 'standards' regarding layout and other ASP.Net things. 4) the coder the ability to tweak this code instance as needed for the specific screen.

So ... Am I crazy?!?!? In relevance to this only please �old girlfriends need not to reply!!

Has anyone tried this type of thing? If so, what kind of things should I consider using in GAT? Pitfalls to avoid, basic suggestions, etc. [And for the record I am not interesting in creating a full blown VSIP thingy �that is not our business �the light weight GAT version is my desired platform] I would think I can have 1 or more T4s execute in one recipe but I would also need to run some"code acceleraters"on pre-existing .aspx / .cs pairs as well (inserting UI controls and relates c# in the code behind class)

Any thoughts shared would be greatly appreciated. I will be going forward with this effort (unless I hear overwhelmingly to the contrary) & keep you posted if interested.

Thanks,

Matt Wilson

Senior Architect
www.lrs.com
wilsonm  Wednesday, October 04, 2006 3:16 AM

Hi Matt,

What you're after sounds totally reasonable. One thing to keep in mind is that although GAX will abstract you from lots of details about implemeting guidance you will still need to be familiar with coding against DTE (which is Visual Studio automation model for extensibility). There are quite a bit of stock Actions in GAX that deal with VS but usually you will face the need to write your custom ones. Also, dont forget to check the different p&p factories that are out there alreay, like Smart Client, Services and Mobile Client. You will find some cool uses of GAX in this factories along with libraries of reusables GAX assets for you to use in your own projects.

And, as you're going to address web development, you can't miss this new factory from p&p which is still in the works: http://www.codeplex.com/Wiki/View.aspx?ProjectName=websf

HTH,
-Victor.

vga  Thursday, October 05, 2006 12:09 AM

Update...

On GotDotNet is the Web Service Factory download (http://www.gotdotnet.com/codegallery/codegallery.aspx?id=6fde9247-53a8-4879-853d-500cd2d97a83) that indeed does have the "GAT" source as well. I stated above that I didn't think it did. These samples have by far been the most helpful to me. From looking at these samples, looking into the MPF stuff, DXCore, CodeDom, and everything in between I have learn a few more things that I was unsure of in my previous posts.

1) The T4 is not limited to file outputs (WSF has samples of it).

2) CodeDom or Env.CodeModel or DXCore.CodeView (your choice) won't be helpful on my aspx portions.

3) In the WSF drop is a Microsoft.Practices.RecipeFramework.Extensions.dll that is awesome. I REALLY wish there was some documentation somewhere that covered it's content.

Now with the research part over, I will proceed with the coding. You haven't heard the last of me!

Thanks again for your comments.

Matt

wilsonm  Wednesday, October 11, 2006 10:14 PM

Hi Matt,

Sorry I never got a chance to reply to your previous questions. How is your project coming? Do you have any pending GAT questions still?

thanks,
-Victor.

vga  Monday, November 13, 2006 5:07 AM

Hi Matt,

What you're after sounds totally reasonable. One thing to keep in mind is that although GAX will abstract you from lots of details about implemeting guidance you will still need to be familiar with coding against DTE (which is Visual Studio automation model for extensibility). There are quite a bit of stock Actions in GAX that deal with VS but usually you will face the need to write your custom ones. Also, dont forget to check the different p&p factories that are out there alreay, like Smart Client, Services and Mobile Client. You will find some cool uses of GAX in this factories along with libraries of reusables GAX assets for you to use in your own projects.

And, as you're going to address web development, you can't miss this new factory from p&p which is still in the works: http://www.codeplex.com/Wiki/View.aspx?ProjectName=websf

HTH,
-Victor.

vga  Thursday, October 05, 2006 12:09 AM

Victor thanks for the reply.

I appreciate the reference to the latest factory that is in progress. Unfortunately, I will have to have my foot soldiers going by December 1 & can not wait for the WCSF to be finished. I am intrigued with their plight as I looked at both the MVC & the MVP as possible designs but found things with each one that didn't settle with me. To create a hybrid is creative & might just be the ticket for their system. So again thanks for the heads up. There are few things however that are hinder me from using the WCSF (beside time as already mentioned)

It is my understanding that the GAT source doesn't come with the factory release just the regular "framework" source. We actually already have built our framework that includes a facade, business, & data SOA centric layers. The UI is truly just a "request & render" element. The piece I would be most interested in seeing from the WCSF would be the raw GAT components but I don't see how p&p can even start them until they have their core classes flushed out. Please note, this is not a compliant at all, I have a lot of respect for p&p and what they have already done for the development community. With our framework I would not want the binaries as is, but instead some starter GAT assets that I could modify to exploit the architecture and metadata within our custom system.

GAT Generation Question:

Along the lines of my GAT needs, I have been looking further at all of the available samples (HOL, GATExLib,& the starter unfolded solution) & have not seen an implementation that has "added" source code to any existingcode file. I grabbed the latest VS SDK release that included the official 1.0 of the DSL, the T4 engine, & most importantly the updated help documentation on it. It appears the T4 always outputs its result into files. This seems to coincide with my lack of sample findings.

I was now thinking that I would need to pair my text transformation with some custom file/text merger. And in the case of pages I would need 2 versions, 1 for the aspx & one for the C# code behind. The "insertion" of the generated asp scripts will be a pain I think because of the various typical nesting of containers & getting it in the correct locations. This just seems too "brute force" to me. Would something like EnvDTE.CodeModel (or something else �**remember new area for me) be more appropriate?!? �This appears to be doable for the C# code behind assets?!? If so, would that also be available on the script based aspx file or something else equivalent?

Thanks again,

Matt

wilsonm  Friday, October 06, 2006 4:06 AM

Update...

On GotDotNet is the Web Service Factory download (http://www.gotdotnet.com/codegallery/codegallery.aspx?id=6fde9247-53a8-4879-853d-500cd2d97a83) that indeed does have the "GAT" source as well. I stated above that I didn't think it did. These samples have by far been the most helpful to me. From looking at these samples, looking into the MPF stuff, DXCore, CodeDom, and everything in between I have learn a few more things that I was unsure of in my previous posts.

1) The T4 is not limited to file outputs (WSF has samples of it).

2) CodeDom or Env.CodeModel or DXCore.CodeView (your choice) won't be helpful on my aspx portions.

3) In the WSF drop is a Microsoft.Practices.RecipeFramework.Extensions.dll that is awesome. I REALLY wish there was some documentation somewhere that covered it's content.

Now with the research part over, I will proceed with the coding. You haven't heard the last of me!

Thanks again for your comments.

Matt

wilsonm  Wednesday, October 11, 2006 10:14 PM

Hi Matt,

Sorry I never got a chance to reply to your previous questions. How is your project coming? Do you have any pending GAT questions still?

thanks,
-Victor.

vga  Monday, November 13, 2006 5:07 AM

Hello there,

bit of an old post.

sounds like you have found what I was looking for,

what have you managed to achieve using t4 in GuidanceAutomationto modify existing files?

Have you got any examples, and is it possible to modify the global.asax to add license keys, or modify a class to add properties and methods?

Regards

Ian

idjones  Monday, October 08, 2007 4:01 PM

Unafortunately there are no way to modify existing files. You should create a template from scratch with all the content of your global.asax and modify it.

hth.

jose.

Jose Escrich  Monday, October 08, 2007 6:22 PM

Thanks for the reply,

are you sure this is correct? In the Guidance Automation help file it mentions under "Providing a User Experience Around a Pattern"

"Modifying Existing Artifacts So They Adhere to a Pattern

The recipes you use are similar to those used for generating new artifacts, but you need to modify them to work with either new or existing participants. When the user of the recipe specifies pre-existing classes in the pattern, the recipe’s actions modify the classes by adding additional methods, properties, and fields so the class includes the structure and relationships as defined by the pattern. The guidance package associates the recipes with shortcut menus on classes or projects and with the Tools menu."

Although I can't find any examples.

Regards

Ian

idjones  Tuesday, October 09, 2007 9:43 AM
Hi Ian,

Jose is correct. Unfortunately there are no built-in Actions in GAX to ease the modification of existing classes, methods, etc.

Usually the add/editing/removing of classes, methods, portions of methods, etc is achived with a combination of different APIs like CodeDOM, Visual Studio CodeModel, etc.

If you can give me a specific example of what you're after I may be able to point you to what would be the best APIs to use for the job.

-Victor.
vga  Thursday, October 18, 2007 6:07 AM

You can use google to search for other answers

Custom Search

More Threads

• How to add a file and project reference
• Trying to add a new class to the References folder...
• Clarius SFT (Jun07) and GAT (Feb08): do they work together?
• Re: How to develop a design center for my website.
• How to validate dependencies from Setup Package
• Conditional Branching of Recipe Actions
• Custom Guidance Package Deployment
• The procedure entry point EncodePointer could not be located in the dynamic link library kernel32.dll
• How to create a database project with template?
• How do I include and reference a custom assembly in my Guidance Package?