现在我将逐步介绍这个工具代码的一些重要部分,描述它们是如何工作的。
I will now step through some major sections of the code describing how they work as I go.
我当然不会违背每一个实例中的应用程序代码和设计,在本系列的第3部分中,我将展示监控数据库以进行性能统计的方法。
I would certainly not side against application code and design in every instance, and in Part 3 of this series, I present methods of monitoring databases for performance statistics.
从那以后,我经常在我课程中的某个部分中加入利用线程的代码书写工作。
Since then, I usually have some part of my courses include writing code that utilizes threads.
对于将在第2部分中讨论的性能测试,我用每一种数据绑定框架来生成代码。
For the performance tests I'll cover in Part 2, I generated code using each of these data binding frameworks.
我仅仅在样本代码中使用了几个的格式化对象,并且仅仅显示了它们特性的一小部分。
I've used only a few formatting objects in the sample code, and I showed only a small portion of their properties.
在本文中,我将那些思想相结合,并提供一个扩展后的案例研究,在该案例研究中,使用一些工具和方法来发现代码库中被忽视但是同样重要的部分。
In this article, I tie those ideas together and present an extended case study, using tools and approaches to discover a neglected but important part of a code base.
我要对我的代码进行模块化,这样就可以有单独的控制器来处理应用的不同部分了。
I like to modularize my code, so I allow separate controllers for different parts of the application.
基于本文的撰写目的,我主要关注于代码清单,因为当您实现这个逻辑之后,其他部分就很简单了。
For the purposes of this article, I concentrate on the body of the of the code list because when you have this logic, developing the other sections is simple.
这个库中实际的反射代码只代表整个实现的一小部分,因此我将主要关注与反射最相关的一些方面。
The actual reflection code within this library represents only a small portion of the full implementation, so I'll focus primarily on the aspects that are most relevant to reflection.
换句话说,我可以只取输出的整数部分并使用它作为预期输出代码的合适位。
In other words, I can simply take the integer portion of the output and use that as the appropriate digit of the expected output code.
注意,为简便起见,我不会详细介绍所有代码,但是我跳过的部分都比较简单,是不言而喻的。
Note that, to simplify the article, I won't cover all of the code in this level of detail, but the parts that I skip should be self explanatory.
这些函数可以在可下载的代码样例(参见下载部分)中找到,但由于它们只是令人厌烦的xml解析函数,因此我在这里没有包括它们。
You can find these functions in the downloadable code sample (see Downloads), but they are just tedious XML parsing functions so I didn't include them here.
在初始移植期间,我开发了一个小型的原型系统(从开发中接收代码)用于关键部分的处理:基于文档的需求的移植。
During an initial migration, I developed a small prototype (receiving bits and pieces of code from development) for the critical part: migration of document-based requirements.
在第1部分开头,我指出代码的TDD版本比后测试版本更好。
Early on in Part 1, I made the claim that the TDD version of the code would be objectively better than the test-after version.
对于本文,我只讨论根据Schema生成代码,但在第2部分,我将研究这两种方法的性能。
For this one I'm only discussing the code generation from Schema, though in Part 2 I'll look at performance for both approaches.
我搜索后发现了SQLite,并决定尝试在我写的免费程序PunjabiKosh中使用部分SQLite数据库引擎代码。
After some searching, I found SQLite and decided to see if I could use part of the database engine code in a freeware application, Punjabi Kosh, that I had written.
我不相信它将会在工作的时候(或者部分),完全改变RubyGems的目标、核心理念和基础代码。
I do not believe it would have been easier (nor appropriate) to completely change the direction, core tenants, and underlying code of RubyGems.
在我介绍每个主题时,我将用一个虚构的书店(以下称AcmeBooksellers)所提供的样本web服务代码来阐述重点部分。
As I cover each topic, I'll illustrate important points with code for a sample web service provided by a fictitious bookstore, hereafter called Acme Booksellers.
当我学习设计模式并将它们作为我设计过程中的一部分时,它使我的代码更优秀。
When I learn design patterns and apply them as part of my design process, it makes my code more robust.
这段代码测试我的问题领域中最关键的部分之一:获取数字的因子。
This code tests one of the most critical parts of my problem domain: getting factors for a number.
首先,我使用了注释来描绘代码的各个部分。
通过本系列的前几期,您已经知道,我的观点是软件的每个部分都包括可重用的代码块。
As you know from the previous installments in this series, my contention is that every piece of software includes reusable chunks of code.
在这篇文章的第二部分,我将介绍如何用AOP系统地保证监视代码不会在被监视的应用程序中造成问题。
In the second half of this article, I'll show you how to use AOP to systematically ensure that monitoring code doesn't cause problems in the monitored application.
在本文的第1部分中,我只讨论基于源代码的插装;您将在第2部分中了解更多关于截取、字节码插装和类包装的信息。
Here in Part 1, I address only source code based instrumentation; you'll read more about interception, bytecode instrumentation, and class wrapping in Part 2.
这就是在“利用可重用代码,第1部分”中我最终重构到它的惯用模式中的代码。
This is the code I ultimately refactor into its own idiomatic pattern in "Leveraging reusable code, Part 1."
虽然我提供了一些代码样本来帮助阐明uml模型与设计,但大多数代码都被缩减到只有关于设计本身的最基本的部分。
While I present code samples which help to illustrate the UML model and design, most of the code has been stripped down to the bare essentials to focus on the design itself.
当我最终强迫自己进行检查时,我才发现这段代码正是罪魁祸首,因此不得不对其中的大部分内容进行重写。
When I finally did force a review, I realized what a disaster the code was, and that most of it had to be rewritten.
在本文前面部分,我提到了对经常遍历代码路径的一些小改善可以获得较大的整体性能收益。
Earlier in the article, I mentioned that small improvements to frequently traversed code paths can lead to big, overall performance gains.
清单9显示了我在“利用可重用代码,第2部分”中引入的一个模式,它以删除结构性重复为名义。
Listing 9 shows a pattern that I introduced in "Leveraging reusable code, Part 2" under the guise of removing structural duplication.
这个应用程序的完整代码可以从源代码下载部分获取,因此我只强调相对表单的最初版本的一些变化。
The complete code for this application can be obtained from the source download, so I'm just going to highlight changes from the original version of the form.
应用推荐