Practical Code Generation in .NET
Author: Peter Vogel
Publisher: Addison Wesley
Pages: 375
ISBN: 978-0321606785
Aimed at: .NET Programmers
Rating: 4.5
Pros: Deals with an interesting and useful topic
Cons: Explanations of the code difficult to follow
Reviewed by: Harry Fairhead

This is a really good idea for a book. It explains how to create Visual Studio add-ins that generate code in response to user input.

It starts off with a chapter on why you might want to do generated code - but of course if you have already bought the book there isn't much need for the hard sell.

Banner

Chapter 2 is where the book really starts, with an introduction to creating an add-in - something that is really quite difficult compared to most other .NET programming tasks. The reason is that you have to learn how to access Visual Studio and this is mostly based on COM.

Chapter 3 gets us deeper into code generation with a look at the code model. Chapter 4 is about working with code in the IDE editor including opening documents, inserting, replacing and formatting text and so on.  Chapter 5 is about working with projects and Chapter 6 is on generating language -neutral code.

If this sounds like an impossible task you haven't made the acquaintance of the Code Dom. The Code Dom lets you build a description of procedural code in terms of objects rather like the HTML Dom represents an HTML page without being HTML itself. Once you have a Code Dom structure it can then be rendered into any language  - well any language there there is a provider for.Of course you can always write your own provider for a language of you choice but even then the Code Dom only supports the language features that are common to all .NET languages.

The final chapters in the section discusses generating code with the new Text Template Transformation Tool, T4, and using other tools.

The second part of the book takes the form of case studies. The first is building a connection string manager. The second is about generating validation code and the final case study is about generating data conversion code.

Overall this is quite a good book in that it takes a single topic and deals with it in detail. As a result this is a fairly advanced book and you need to be prepared to do some work in understanding it. However this said the author could have done more to make it seem simpler. The explanations of the code for example are difficult to follow. It is often difficult to work out which particular bit of code the explanations refer to. Overall the result is confusing.

That about sums the book up, confusing in parts but overall if you are interested in code generation its essential reading.


Banner


Modern JavaScript: Develop and Design

Author: Larry Ullman
Publisher: Peachpit Press
Pages: 624
ISBN: 978-0321812520
Aimed at: Web designers
Rating: 4
Pros: In-depth treatment
Cons: Not object-oriented
Reviewed by:

Modern JavaScript - what exactly does that mean?



Basic Robot Building With LEGO Mindstorms NXT 2.0

Author: John Baichtal
Publisher: Que, 2013
Pages: 224
ISBN: 978-0789750198
Audience: Newcomers to Lego Mindstorms from 8 to ...
Rating: 5
Reviewer: Harry Fairhead

Getting started with building and programming robots requires a lot of different skills - even if you take a shortcut with Lego Mindstorms. Ha [ ... ]


More Reviews

 

Last Updated ( Thursday, 17 June 2010 )
 
 

   
RSS feed of book reviews only
I Programmer Book Reviews
RSS feed of all content
I Programmer Book Reviews
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.