惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
B
Blog RSS Feed
A
About on SuperTechFans
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
D
Docker
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
H
Help Net Security
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
博客园 - Franky
人人都是产品经理
人人都是产品经理
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog

博客园 - 融化了的朱古力

AJAX Automated Testing Object design Professional asp.net 2.0 server control and component development Online dictionary ASP.NET 2.0服务器控件与组件开发高级编程 Professional asp.net 2.0 Server Control and Component Development .NET组件程序设计 .NET组件程序设计0723 .NET组件程序设计0721 .NET组件程序设计 never draw to an inside straight Per say Agile Principles, Patterns, and Practices in C# MapControl MapPoint Helpful Links 20060827 20060812 what is locality of reference? 20060806
20060802
融化了的朱古力 · 2006-08-02 · via 博客园 - 融化了的朱古力

I call the manually written code handcrafted code because it brings to mind the respect I have for handcrafted items.

Unless there are underlying differences between the three, examples in later sections of this book illustrate only XSLT to keep things focused on the core aspects of code generation beyond how you spit out code.

Each step lays the groundwork for the next step, but it also provides information for refining the previous step.
为下一步奠定基础

The highest payback for code generation is creating middle-tier data containers and data access layers, so a lot of the code in this book focuses on those areas.
最大的回报

I'm so reliant on this technique that even when creating the “Hello World” examples, I first created a target source code file and then copied and pasted it into the template.
信任该技术

As your skills and understanding of code generation increase, you'll contemplate what other sections of your application might be good candidates to move from handcrafted code to autogenerated code.

When the line between the code you should autogenerate and code you should handcraft seems blurry, lean to the conservative side and handcraft more code.

The most important single thing you'll learn from this book may be to become comfortable with design decisions that allow you to combine code generation and class-specific code to provide each class full functionality and personality while retaining your ability to regenerate at will.

Development tends to be a zero-sum game, meaning that extra resources required on one task are taken from another. Too often, resources used by development problems or new features are taken from testing. I hope that as code generation speeds your development, you'll have more time for testing. But I'm not optimistic about it.

Hold generated code to the same high-quality standards you use for the rest of your code, and treat it with the same care—including source control and testing.

These principles are my non-negotiables for code generation:

Although metadata and templates are highly symbiotic, they evolve in response to separate pressures.
高度相互依赖

I want to have my cake and eat it, too!

Code generation is a design-time feature and will have no negative impact on runtime performance.

First, because code-generated parts of your application are repetitively created, if you're in triage mode, you can limit testing to a few examples of each pattern, rather than testing every class. I'm not suggesting this is a good idea, but triage is always a matter of picking the best of bad choices.
两害择其轻

The IndentedTextWriter makes for a few more lines of code but is a less of a pain to keep the code lined up.
导致多几行代码

Don't be concerned if you feel lost or just don't understand the CodeDOM at this point.
别担心