| By Tad Anderson | Article Rating: |
|
| May 28, 2011 11:30 AM EDT | Reads: |
1,336 |
| When it comes to code generation I have seen the worst of the worst and some really cool implementations. The worst was on a large government project. The consulting firm created a custom code generator that created every layer of the 5 layer application. In truth, the only reason the project was so large was because of the effort that went into the implementation and maintenance of the code generation application. As time went on the firm lost all control of the relationship between the generated code and the application that created it. Maintenance teams needed to be in place for both the production code and the generation tool. Needless to say a ton of money was wasted on the project. The best was the use of the GAT and GAX tools to put code generation tools in place to support a Software Product Line Engineering project. The tools generated project shells, added different components based on wizard selection, built configuration files, and included item level recipes. The code generation tools didn't attempt to control the application implementation, it only enhanced it. It was used to increase productivity and help enforce consistency. I was glad to find that the author does not attempt to implement a grandiose code generation monstrosity like the consulting firm did in my first example. He actually does a really great job of warning the reader to not go overboard with code generation. The book covers Visual Studio Add-ins, generating code with the CodeModel, FileCodeModel, VsWebsite, and VSLangProj, generating solutions and projects, modifying text in the code editorT4 Templates, item templates, and attributes. The book ends with 3 sizable case studies. They include Generating a Connection String Manager, Generating Validation Code, and Generating Data-Conversion Code. You can read Generating a Connection String Manager on the informIT web site. The biggest let down I found with this book is the downloadable code. The author has 2 of the case studies available for download, but does not have sample per chapter available. You also need to install DSL Toolkit to get the Generating Data-Conversion Code project to load in Visual Studio 2008, but it didn't load in Visual Studio 2010. One of the things I like the most about the book is that the author really shows you how to take advantage of existing tools and libraries that are intended to be used for code generation. In the large government project I mentioned above, they re-invented every size wheel you can think of. Everything was done from scratch and did not take advantage of any of the framework tools. Over all I would recommend this book to anyone interested in code generation with the .NET framework and Visual Studio. It will definately get you moving in the right direction. |
Practical Code Generation in .NET: Covering Visual Studio 2005, 2008, and 2010 (Addison-Wesley Microsoft Technology Series) |
CIO, CTO & Developer Resources
Published May 28, 2011 Reads 1,336
Copyright © 2011 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
Related Stories
- SPI Dynamics Participates in Microsoft Visual Studio 2005 Global Launch
- Microsoft Details Pricing and Licensing for Visual Studio 2005 and Simplifies Microsoft Developer Network Subscriptions
- Dexterra Continues Their Track Record of Innovation With Complete Support for Microsoft Visual Studio 2005, SQL Server 2005 and Windows Mobile 5.0
- Microsoft Shows Off Win8 Tablet OS
- High-Profile Investor Wants Ballmer Out
- Book Review: The Art of Enterprise Information Architecture
- Microsoft to Collect More Android Royalties
- Book Review: Practical Code Generation in .NET
- Microsoft – Where Will It Be in Ten Years?
- How to Start Unit Testing .NET Projects
- Can PowerBuilder Leverage Mono?
- Book Review: Parallel Programming with Microsoft .NET
- Book Review: Pro ASP.NET MVC 3 Framework
- Olympics Tickets Disappointment Likely To Lead To Holiday Booking Uplift
- La computación en nube abre nuevas posibilidades para la investigación del cáncer
- GISUser.com GIS Data, news, jobs, software tips, mashup news – Developing Location Based Services (LBS) Mobile Applications
- Microsoft Shows Off Win8 Tablet OS
- High-Profile Investor Wants Ballmer Out
- Create a Public Facing Website with SharePoint Online
- Book Review: The Art of Enterprise Information Architecture
- Microsoft to Collect More Android Royalties
- Silverlight Integration Pack for Microsoft Enterprise Library 5.0
- Book Review: Beginning ASP.NET 4 in C# 2010
- Book Review: Microsoft Expression Blend Unleashed
- Book Review: UML 2 and the Unified Process
- This is a win-win opportunity, why don't you make use of it?
- Book Review: Practical Code Generation in .NET
- Where Are RIA Technologies Headed in 2008?
- Accessing the ASP.NET Authentication, Profile and Role Service in Silverlight
- The Top 250 Players in the Cloud Computing Ecosystem
- Building Great AJAX Applications Using ASP.NET
- Silverlight 2 - Adobe Flex Killer Is on Its Way!
- Spice Up User Experience with Silverlight
- Is the Silverlight Adoption Rate Artificially Inflated?
- Will Google's Android Sink or Swim?
- Kaazing Announces Support for Silverlight
- The Next Chapter in the Virtualization Story Begins
- Rich Content Rotator for ASP.NET
- Getting Started with Silverlight: Zero to Hero


































