InfoQ

News

CodeSmith 4.1.1 supports Visual Studio 2008 Beta 2

Posted by Hartmut Wilms on Aug 02, 2007 11:48 AM

Community
.NET
Topics
Programming
Tags
LINQ ,
Code Generation ,
Visual Studio

CodeSmith is a template-based code generator that automatically generates high level code (C#, VB.NET, ...). The current release features LINQ to SQL templates and supports Visual Studio 2008 Beta 2.

CodeSmith templates are coded in an ASP.NET like syntax, which allows .NET developers to write templates in one of the following languages:C#, VB.NET or JScript.NET. The templates define what will be generated by the CodeSmith generator. The generated code may be customized by the use of properties. Properties may be any .NET object, ranging from a simple boolean value to the representation of database metadata.

CodeSmith provides LINQ to SQL templates since release 4.1.0, which added the following features:

  • Microsoft Visual Studio 2008 “Orcas” Support – CodeSmith has been updated to support the latest version of Visual Studio codenamed “Orcas”.
  • Linq to Sql templates – Generates LINQ classes as well as manager classes to make it easier to execute common queries, manage validation, and add business rules. It’s “SQL Metal” on steroids.
  • New Schema Providers – Contributed from the CodeSmith community, the MySQL and Oracle schema providers now included.

The current release includes "updated LINQ templates to work with Visual Studio 2008 Beta 2". Although Visual Studio 2008 provides a visual designer, which helps to create SQL to LINQ mappings, the code generation approach of CodeSmith has some advantages:

  • You are in complete control of how mappings are generated.
  • The generation of mappings may be incorporated into your build process. CodeSmith features a console generator and supports MSBuild.
  • Changes to the database scheme are automatically synchronized with your source by starting a new build or generating code manually.

David Hayden compares the designer and the code generation approach in his post on Code Generation using CodeSmith - v4.1 - Visual Studio 2008 Support and LINQ to SQL Templates and comes to the following conclusion:

Although the LINQ to SQL Visual Designer is very cool and very productive, I have been burned badly by Visual Designers in the past and would prefer to have each LINQ to SQL Entity in its own non-visual designer file just like every other class in Visual Studio.

What do you think?

No comments

Watch Thread Reply

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.