• Complain

Kevin Hazzard - Metaprogramming in .NET

Here you can read online Kevin Hazzard - Metaprogramming in .NET full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2013, publisher: Manning Publications, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Kevin Hazzard Metaprogramming in .NET

Metaprogramming in .NET: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Metaprogramming in .NET" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Summary

Metaprogramming in .NET is designed to help readers understand the basic concepts, advantages, and potential pitfalls of metaprogramming. It introduces core concepts in clear, easy-to-follow language and then it takes you on a deep dive into the tools and techniques youll use to implement them in your .NET code. Youll explore plenty of real-world examples that reinforce key concepts. When you finish, youll be able to build high-performance, metaprogramming-enabled software with confidence.

About the Technology

When you write programs that create or modify other programs, you are metaprogramming. In .NET, you can use reflection as well as newer concepts like code generation and scriptable software. The emerging Roslyn project exposes the .NET compiler as an interactive API, allowing compile-time code analysis and just-in-time refactoring.

About this Book

Metaprogramming in .NET is a practical introduction to the use of metaprogramming to improve the performance and maintainability of your code. This book avoids abstract theory and instead teaches you solid practices youll find useful immediately. It introduces core concepts like code generation and application composition in clear, easy-to-follow language.

Written for readers comfortable with C# and the .NET frameworkno prior experience with metaprogramming is required.

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

Whats Inside

  • Metaprogramming concepts in plain language
  • Creating scriptable software
  • Code generation techniques
  • The Dynamic Language Runtime

About the Authors

Kevin Hazzard is a Microsoft MVP, consultant, teacher, and developer community leader in the mid-Atlantic USA. Jason Bock is an author, Microsoft MVP, and the leader of the Twin Cities Code Camp.

An excellent way to start fully using the power of metaprogramming.From the Foreword by Rockford Lhotka, Creator of the CSLA .NET Framework

Table of Contents

    PART 1 DEMYSTIFYING METAPROGRAMMING
  1. Metaprogramming concepts
  2. Exploring code and metadata with reflection
  3. PART 2 TECHNIQUES FOR GENERATING CODE
  4. The Text Template Transformation Toolkit (T4)
  5. Generating code with the CodeDOM
  6. Generating code with Reflection.Emit
  7. Generating code with expressions
  8. Generating code with IL rewriting
  9. PART 3 LANGUAGES AND TOOLS
  10. The Dynamic Language Runtime
  11. Languages and tools
  12. Managing the .NET Compiler

Kevin Hazzard: author's other books


Who wrote Metaprogramming in .NET? Find out the surname, the name of the author of the book and a list of all author's works by series.

Metaprogramming in .NET — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Metaprogramming in .NET" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Metaprogramming in .NET
Kevin Hazzard and Jason Bock

Metaprogramming in NET - image 1

Copyright

For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact

Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 261 Shelter Island, NY 11964 Email: orders@manning.com

2013 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher.

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps.

Picture 2 Recognizing the importance of preserving what has been written, it is Mannings policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine.

Metaprogramming in NET - image 3Manning Publications Co.20 Baldwin RoadPO Box 261Shelter Island, NY 11964Development editor: Cynthia KaneCopyeditor: Corbin CollinsTechnical proofreader: Justin ChaseProofreader: Elizabeth MartinTypesetter: Dennis DalinnikCover designer: Marija Tudor

Printed in the United States of America

1 2 3 4 5 6 7 8 9 10 MAL 18 17 16 15 14 13 12

Brief Table of Contents
Table of Contents
Foreword

When I think about metaprogramming I view it through three sets of experience: as a computer scientist, a business developer, and a .NET framework author.

From a computer science perspective, it is clear that our industry has been largely stagnant from a language perspective for an extremely long time. The slow evolution of 3GLs (third-generation languages) from C to C++ to Java to C# has resulted in incremental improvements, but no major leaps in terms of developer productivity, maintainability of code, reduction of complexity, or other meaningful metrics.

(I chose the C language progression in my example because it is perhaps the most widely known. Comparable progressions exist for BASIC, Pascal, and many other language families.)

Metaprogramming offers interesting possibilities around the creation of domain-specific languages and other abstraction concepts that could eventually break us out of the 3GL world weve lived in for the past 20-30 years. Although this book doesnt focus on such a long-term goal, I think you can use Metaprogramming in .NET as a starting point to gain valuable perspective on myriad core ideas that might inspire you to think more about the future of our industry.

As someone whos been a business developer for over 25 years, Ive watched as metaprogramming has become one of the most mainstream and important tools for software development. Metaprogramming enables development time code generation as well as software that can dynamically adapt its behaviors at runtime.

In the mid-1990s people mocked attempts by Microsoft and others to create wizards that generated code for various business application scenarios. Today, such code generation tools are considered invaluable in environments as varied as Ruby on Rails, Eclipse, and Visual Studio. Most business developers rely daily on massive amounts of code generated by their tools during the development and build process.

Similarly, developers rely on runtime-generated code created by test mocking frameworks, dynamic UI generation tools, rules engines, and more. Even more subtle aspects of metaprogramming, such as the use of introspection (reflection) to create data binding frameworks, are pervasive.

This book explores a number of the underlying technologies and techniques used to implement code generation and dynamic applications during the development, build, and runtime phases of an applications lifecycle. Understanding these concepts is important for effective use of existing tools, and critical for creating your own or improving those that exist.

Finally, I am the author of the widely used CSLA .NET business objects framework. Within my framework I make extensive use of many of the techniques discussed in this book, including reflection, dynamic type loading, and expression trees.

A framework such as CSLA .NET couldnt exist without these technologies, and without the basic concepts of metaprogramming. Nor is CSLA .NET unique in this regard. Many frameworks in the data layer, business layer, and presentation layer make heavy use of metaprogramming techniques to provide broad and flexible support for object-relational mapping, business rules, validation rules, data binding, and dynamic UI generation.

In my view, metaprogramming is extremely important because its core concepts are used in popular development and testing frameworks and tools, as well as to enable code generation tooling and dynamic application behaviors. It is also one of the most promising areas of focus for the future of our industry as we look for ways to improve maintainability and reduce the cost of software over its lifetime.

This book is an excellent way to get started down the road of understanding and fully using the power of metaprogramming.

R OCKFORD L HOTKA
CTO AT M AGENIC
C REATOR OF THE CSLA .NET F RAMEWORK

Preface

In software development, metaprogramming is one of those words that sounds fancy and sophisticatedand somewhat intimidating at the same time. But what does it mean to be doing metaprogramming? The meta prefix can mean changed or higher. It can also mean after or beside, depending on the context. All of those terms describe the various forms of metaprogramming that we cover in this book.

You may choose to do metaprogramming in order to change code to support a higher level of abstraction within your system or to inject some new behavior that suits your particular needs. You may choose to do these things at compile time, between compile time and deployment, or even at runtime. Because of the flexible nature of the meta prefix, all of these scenarios qualify as metaprogramming.

No matter your reasons for doing metaprogramming, you must have a firm grip on the larger architectural picture of your project to do it effectively. Thats why metaprogramming is sometimes considered a dark art, to be practiced only by senior developers and architects. Nothing could be further from the truth. Everyone can do some form of metaprogramming. By manipulating code with other code the metaprogramming way, you can suddenly tackle classes of coding problems that you were never able to overcome before.

Your foray into metaprogramming may be to improve code reuse through simple templating or reflection. But soon you might also find yourself doing it to reduce the complexity of your systems. For example, weaving the code that does logging, performance monitoring, or transaction handling into a class library after its been compiled can greatly increase developer comprehension by reducing code complexity. Hiding all of that plumbing with metaprogramming can benefit everyone on the team.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Metaprogramming in .NET»

Look at similar books to Metaprogramming in .NET. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Metaprogramming in .NET»

Discussion, reviews of the book Metaprogramming in .NET and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.