没有合适的资源?快使用搜索试试~ 我知道了~
.NET实用代码生成 Practical_Code_Generation_in_NET
5星 · 超过95%的资源 需积分: 0 39 下载量 33 浏览量
2013-03-29
21:03:13
上传
评论
收藏 3.05MB PDF 举报
温馨提示
试读
527页
.NET实用代码生成Practical_Code_Generation_in_NET
资源推荐
资源详情
资源评论
P
RACTICAL
C
ODE
G
ENERATION
IN
.NET
C
OVERING
V
ISUAL
S
TUDIO
®
2005, 2008,
AND
2010
Peter Vogel
Upper Saddle River, NJ • Boston • Indianapolis • San Francisco
New York • Toronto • Montreal • London • Munich • Paris • Madrid
Capetown • Sydney • Tokyo • Singapore • Mexico City
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trade-
marks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the
designations have been printed with initial capital letters or in all capitals.
The author and publisher have taken care in the preparation of this book, but make no expressed or implied
warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for inciden-
tal or consequential damages in connection with or arising out of the use of the information or programs con-
tained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special
sales, which may include electronic versions and/or custom covers and content particular to your business,
training goals, marketing focus, and branding interests. For more information, please contact:
U.S. Corporate and Government Sales
(800) 382-3419
For sales outside the United States please contact:
International Sales
Visit us on the Web: informit.com/aw
Library of Congress Cataloging-in-Publication Data:
Vogel, Peter, 1953-
Practical code generation in .NET : covering Visual Studio 2005, 2008, and 2010 / Peter Vogel.
p. cm.
Includes bibliographical references and index.
ISBN 978-0-321-60678-5 (pbk. : alk. paper)
1. Microsoft Visual studio. 2. Code generators. 3. Microsoft .NET Framework. I. Title.
QA76.76.G46V65 2010
006.7'882--dc22
2010003301
Copyright © 2010 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and
permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval
system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or like-
wise. For information regarding permissions, write to:
Pearson Education, Inc.
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax (617) 671 3447
ISBN-13: 978-0-321-60678-5
ISBN-10: 0-321-60678-7
Text printed in the United States on recycled paper at RR Donnelly in Crawfordsville, Indiana.
First printing April 2010
For Jan. Always.
iv
C
ONTENTS
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Chapter 1 Introducing Code Generation . . . . . . . . . . . . . . . . . . . . . 1
Repetitive Code: Your History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Copy-and-Paste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
General-Purpose Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Benefits of Code Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
When to Use Code Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Best Practices in Code-Generation Solutions . . . . . . . . . . . . . . . . . . . 10
Code-Generation Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Code-Generation Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Model-Driven Architecture, Declarative Programming,
and Code Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Model-Driven Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Declarative Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
PART I: T
OOLS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 2 Integrating with Visual Studio . . . . . . . . . . . . . . . . . . . . 21
Design-Time Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Starting Your Visual Studio Add-In . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Laying the Foundation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Integrating with Visual Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Writing a Generation Class in Visual Studio . . . . . . . . . . . . . . . . . 30
Working with COM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
剩余526页未读,继续阅读
资源评论
- nyfor2013-06-25很棒,对我写VS插件很有帮助.谢谢.要是有人翻译成中文就更好了.
- ciwen912014-12-18好东西,要是有中文的就好了
txp914
- 粉丝: 22
- 资源: 725
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功