My Account Log in

1 option

Practical code generation in .NET : covering Visual Studio 2005, 2008, and 2010 / Peter Vogel.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Vogel, Peter, 1953-
Language:
English
Subjects (All):
Microsoft Visual studio.
Code generators.
Microsoft .NET Framework.
Physical Description:
1 online resource (xiii, 344 p.) : ill.
Edition:
1st edition
Place of Publication:
Upper Saddle River, N.J. : Addison-Wesley, c2010.
System Details:
text file
Summary:
“Once this skill is within your everyday comfort zone, it will give your productivity a boost and increase your value to your team. I encourage you to add the techniques outlined in this book to your toolset and to use them to develop your own workbench of generative tools. In doing so, I’m confident you’ll improve your capabilities, and what’s more, have fun doing so.” –From the Foreword by Gareth Jones, Developer Architect, Visual Studio ® , Microsoft Enlist Visual Studio’s Built-in Code Generation Tools to Write Better Software Faster Automatic code generation can dramatically increase your productivity, improve code quality and maintainability, promote reuse, and help you extend best practices throughout your development organization. .NET and Visual Studio contain many powerful, code-generation tools--and this book shows you how to succeed with all of them. With Practical Code Generation in .NET , spend less time writing monotonous, repetitive code--leaving more time to address troublesome areas! Microsoft MVP Peter Vogel covers code generation with Visual Studio 2010, 2008, and 2005, as well as all recent versions of .NET, including .NET 4.0. You’ll learn when enlisting code generation makes sense and how to design solutions that build on the skills and resources you already have. Writing for experienced programmers, Vogel shows how to generate reliable code using procedural code, Visual Studio add-ins, XML, configuration files, and more--including Microsoft’s innovative CodeDOM technology for generating code in multiple languages. He brings everything together in three complete, chapter-length case studies. Coverage includes • Understanding the structure of .NET code-generation solutions and best practices for architecting them • Creating Visual Studio add-ins that quickly integrate code generation into day-to-day activities • Using objects and methods to add or remove project components • Using text insertion to generate code using any tool--even standard string handling functions • Working with the specific features of C#, Visual Basic .NET, and ASP.NET • Generating more concise code with .NET’s new Text Template Transformation Toolkit (T4) • Building code-generation solutions with Visual Studio templates, attributes, and custom tools • Distributing code-generation solutions
Contents:
Cover
Contents
Foreword
Preface
Acknowledgments
About the Author
Chapter 1 Introducing Code Generation
Repetitive Code: Your History
Copy-and-Paste
General-Purpose Code
Benefits of Code Generation
When to Use Code Generation
Best Practices in Code-Generation Solutions
Code-Generation Process
Code-Generation Tools
Model-Driven Architecture, Declarative Programming, and Code Generation
Model-Driven Architecture
Declarative Programming
PART I: TOOLS
Chapter 2 Integrating with Visual Studio
Design-Time Integration
Starting Your Visual Studio Add-In
Creating a Menu-Driven User Interface
Working with Visual Studio Windows
Responding to Events
Accepting Input
Integrating with Visual Studio
Chapter 3 Manipulating Project Components
The Code Model
Managing Projects and Solutions
Generating Code
Modifying and Analyzing Components
Processing Components in a File
Working with Retrieved Elements
Working with the CodeType Objects
Storing Information
Working with Project Components
Chapter 4 Modifying Code in the Editor
Opening and Closing Documents and TextDocuments
Backing Out Changes
Creating EditPoints to Access Text
Retrieving Information
Accessing Text with an EditPoint
Working with Bookmarks
Inserting, Replacing, and Formatting Text
Inserting and Reading Text
Chapter 5 Supporting Project-Specific Features
Introducing the VSLangProj Libraries
Managing a "Projectless" Website
Project-Specific Features
Chapter 6 Generating Language-Neutral Code
A Comprehensive Example
Declarations
Defining Classes
Class Members
Statements and Expressions
Code Structures
When All Else Fails: Code Snippets
Other Code Features
Code Providers
Generating Code.
Chapter 7 Generating Code from Templates with T4
T4 in Visual Studio
T4 Code-Generation Strategies
Creating a T4 Template
Extending T4
Invoking Templates from Code
Leveraging Templates
Chapter 8 Other Tools: Templates, Attributes, and Custom Tools
Item Templates
Attributes
Generating Code from Custom File Formats
Reviewing the Tools
PART II: CASE STUDIES
Chapter 9 Case Study: Generating a Connection String Manager
Defining the Problem
Setting Up the Add-In
Creating the Code Generator
Customizing the Template
Reading Input
Notifying the Developer
Supporting Customization
Tying Generation to Events
Generating a Simple Class
Chapter 10 Case Study: Generating Validation Code
Starting the Code-Generation Project
Wiring Up the Add-In
Starting the Generation Utility
Defining a Template
Specifying Code with the CodeDom
Generating Code in the Target Language
Supporting "Projectless" Websites
Handling Errors
Building a Complete Code-Generation Solution
Chapter 11 Case Study: Generating Data-Conversion Code
Creating the Designer
Enhancing Model Validation
Distributing Your Designer
Visual Studio 2010 Additions
Capturing Inputs
PART III: APPENDIXES
Appendix A: Generating Menu Names
Appendix B: Options Dialog Categories, Subcategories, and Properties
Appendix C: A Code-Generation Add-In
Integrating Code-Generation Classes
Appendix D: Distributing Code-Generation Solutions
Creating the .vscontent File
A Complete Example
Installing the Solution
Index.
Notes:
Description based on print version record.
Includes bibliographical references and index.
Description based on publisher supplied metadata and other sources.
ISBN:
9786612568879
9780321617606
0321617606
9780321606785
0321606787
9781282568877
1282568876
OCLC:
608313226

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account