﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-子弹的VISIONS-随笔分类-1.x 临时目录</title><link>http://www.cppblog.com/ztwaker/category/7256.html</link><description>&lt;font color=#FF0000&gt;/* 掌握未来最大的趋势：信息化、自动化、一体化、人性化 */  &lt;/font&gt;&lt;font color=#00FF00&gt;[终需有日龙穿凤 唔使日日裤穿窿]&lt;/font&gt;</description><language>zh-cn</language><lastBuildDate>Thu, 14 Aug 2008 15:11:40 GMT</lastBuildDate><pubDate>Thu, 14 Aug 2008 15:11:40 GMT</pubDate><ttl>60</ttl><item><title>The Usability of Open Source Software (ZT)</title><link>http://www.cppblog.com/ztwaker/archive/2008/08/14/58838.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Thu, 14 Aug 2008 05:50:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/08/14/58838.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/58838.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/08/14/58838.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/58838.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/58838.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: The Usability of Open Source Software by David M. Nichols and Michael B. TwidaleOpen source communities have successfully developed a great deal of software although most computer users only use propr...&nbsp;&nbsp;<a href='http://www.cppblog.com/ztwaker/archive/2008/08/14/58838.html'>阅读全文</a><img src ="http://www.cppblog.com/ztwaker/aggbug/58838.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-08-14 13:50 <a href="http://www.cppblog.com/ztwaker/archive/2008/08/14/58838.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Usability 101: Introduction to Usability(ZT)</title><link>http://www.cppblog.com/ztwaker/archive/2008/08/14/58837.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Thu, 14 Aug 2008 05:44:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/08/14/58837.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/58837.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/08/14/58837.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/58837.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/58837.html</trackback:ping><description><![CDATA[<div class=maintext>
<p class=overline><strong><a title="Author biography" href="http://www.useit.com/jakob/"><u><font color=#0000ff>Jakob Nielsen</font></u></a>'s Alertbox, August 25, 2003:</strong></p>
<h1>Usability 101: Introduction to Usability</h1>
<blockquote style="BACKGROUND-COLOR: #ffffdd"><strong>Summary:</strong> <br>How to define usability? How, when, and where can you improve it? Why should you care? This overview answers these basic questions. </blockquote>
<p>This is the article to give to your boss or anyone else who doesn't have much time, but needs to know the basic usability facts.
<h2>What (Definition of Usability)</h2>
Usability is a <strong>quality attribute</strong> that assesses how easy user interfaces are to use. The word "usability" also refers to methods for improving ease-of-use during the design process.
<p>Usability is defined by five quality components:
<ul>
    <li><strong>Learnability</strong>: How easy is it for users to accomplish basic tasks the first time they encounter the design?
    <li><strong>Efficiency</strong>: Once users have learned the design, how quickly can they perform tasks?
    <li><strong>Memorability</strong>: When users return to the design after a period of not using it, how easily can they reestablish proficiency?
    <li><strong>Errors</strong>: How many errors do users make, how severe are these errors, and how easily can they recover from the errors?
    <li><strong>Satisfaction</strong>: How pleasant is it to use the design? </li>
</ul>
There are many other important quality attributes. A key one is <strong>utility</strong>, which refers to the design's functionality: Does it do what users need? Usability and utility are equally important: It matters little that something is easy if it's not what you want. It's also no good if the system can hypothetically do what you want, but you can't make it happen because the user interface is too difficult. To study a design's utility, you can use the same user research methods that improve usability.
<h2>Why Usability is Important</h2>
On the Web, usability is a necessary condition for survival. If a website is difficult to use, people <strong>leave</strong>. If the <a class=old title="Alertbox, May 2002: Top Ten Guidelines for Homepage Usability" href="http://www.useit.com/alertbox/20020512.html"><u><font color=#0000ff>homepage</font></u></a> fails to clearly state what a company offers and what users can do on the site, people <strong>leave</strong>. If users get lost on a website, they <strong>leave</strong>. If a website's information is hard to read or doesn't answer users' key questions, they <strong>leave</strong>. Note a pattern here? There's no such thing as a user reading a website manual or otherwise spending much time trying to figure out an interface. There are plenty of other websites available; leaving is the first line of defense when users encounter a difficulty.
<p>The first law of <a class=old title="Alertbox, Aug. 2001: Did Poor Usability Kill E-Commerce?" href="http://www.useit.com/alertbox/20010819.html"><u><font color=#0000ff>e-commerce</font></u></a> is that if users cannot <em>find</em> the product, they cannot <em>buy</em> it either.
<p>For <strong>intranets</strong>, usability is a matter of <a class=old title="Alertbox, Nov. 2002: Intranet Usability: The Trillion-Dollar Question" href="http://www.useit.com/alertbox/20021111.html"><u><font color=#0000ff>employee productivity</font></u></a>. Time users waste being lost on your intranet or pondering difficult instructions is money you waste by paying them to be at work without getting work done.
<p>Current best practices call for spending about <strong>10% of a design project's budget</strong> on usability. On average, this will more than <a class=old title="Alertbox: Return on Investment (ROI) for Usability" href="http://www.useit.com/alertbox/roi.html"><u><font color=#0000ff>double a website's desired quality metrics</font></u></a> and slightly less than double an intranet's quality metrics. For software and physical products, the improvements are typically smaller — but still substantial — when you emphasize usability in the design process.
<p>For internal design projects, think of doubling usability as cutting training budgets in half and doubling the number of transactions employees perform per hour. For external designs, think of doubling sales, doubling the number of registered users or customer leads, or doubling whatever other desired goal motivated your design project.
<h2>How to Improve Usability</h2>
There are many methods for studying usability, but the most basic and useful is <strong>user testing</strong>, which has three components:
<ul>
    <li>Get hold of some <strong><a class=old title="Alertbox Jan. 2003: Recruiting Test Participants for Usability Studies" href="http://www.useit.com/alertbox/20030120.html"><u><font color=#0000ff>representative users</font></u></a></strong>, such as customers for an e-commerce site or employees for an intranet (in the latter case, they should work outside your department).
    <li>Ask the users to perform <strong>representative tasks</strong> with the design.
    <li><strong>Observe</strong> what the users do, where they succeed, and where they have difficulties with the user interface. Shut up and let the users do the talking. </li>
</ul>
It's important to test users individually and let them solve any problems on their own. If you help them or direct their attention to any particular part of the screen, you have contaminated the test results.
<p>To identify a design's most important usability problems, <a class=old title="Alertbox, March 2000: Why You Only Need to Test With 5 Users" href="http://www.useit.com/alertbox/20000319.html"><u><font color=#0000ff>testing five users</font></u></a> is typically enough. Rather than run a big, expensive study, it's a better use of resources to run many small tests and revise the design between each one so you can fix the usability flaws as you identify them. Iterative design is the best way to increase the quality of user experience. The more versions and interface ideas you test with users, the better.
<p>User testing is different from <a class=old title="Jakob Nielsen essay from 1997: The Use and Misuse of Focus Groups" href="http://www.useit.com/papers/focusgroups.html"><u><font color=#0000ff>focus groups</font></u></a>, which are a poor way of evaluating design usability. Focus groups have a place in market research, but to evaluate interaction designs you must closely observe individual users as they perform tasks with the user interface. <a class=old title="Alertbox, Aug. 2001: First Rule of Usability? Don't Listen to Users" href="http://www.useit.com/alertbox/20010805.html"><u><font color=#0000ff>Listening to what people say</font></u></a> is misleading: you have to watch what they actually do.
<h2>When to Work on Usability</h2>
Usability plays a role in each stage of the design process. The resulting need for multiple studies is one reason I recommend making individual studies fast and cheap. Here are the main steps:
<ol>
    <li>Before starting the new design, <strong>test the old design</strong> to identify the good parts that you should keep or emphasize, and the bad parts that give users trouble.
    <li>Unless you're working on an intranet, <strong>test your competitors' designs</strong> to get cheap data on a range of alternative interfaces that have similar features to your own. (If you work on an intranet, read the <a class=old title="Nielsen Norman Group: list of intranet usability reports" href="http://www.nngroup.com/reports/intranet/"><u><font color=#0000ff>intranet design annuals</font></u></a> to learn from other designs.)
    <li>Conduct a <strong>field study</strong> to see how users behave in their natural habitat.
    <li>Make <strong><a class=new title="Nielsen Norman Group training film on DVD: Paper Prototyping - A How-To Video" href="http://www.nngroup.com/reports/prototyping/"><u><font color=#0000ff>paper prototypes</font></u></a></strong> of one or more new design ideas and test them. The less time you invest in these design ideas the better, because you'll need to change them all based on the test results.
    <li>Refine the design ideas that test best through <strong>multiple iterations</strong>, gradually moving from low-fidelity prototyping to high-fidelity representations that run on the computer. Test each iteration.
    <li>Inspect the design relative to <strong><a class=old title="Nielsen Norman Group: list of usability guidelines reports" href="http://www.nngroup.com/reports/"><u><font color=#0000ff>established usability guidelines</font></u></a></strong>, whether from your own earlier studies or published research.
    <li>Once you decide on and implement the <strong>final design</strong>, test it again. Subtle usability problems always creep in during implementation. </li>
</ol>
Don't defer user testing until you have a fully implemented design. If you do, it will be impossible to fix the vast majority of the critical usability problems that the test uncovers. Many of these problems are likely to be structural, and fixing them would require major rearchitecting.
<p>The only way to a high-quality user experience is to start user testing early in the design process and to keep testing every step of the way.
<h2>Where to Test</h2>
If you run at least one user study per week, it's worth building a dedicated usability laboratory. For most companies, however, it's fine to conduct tests in a conference room or an office — as long as you can close the door to keep out distractions. What matters is that you get hold of real users and sit with them while they use the design. A notepad is the only equipment you need.
<h2>Learn More</h2>
My next column will address the main <a class=new href="http://www.useit.com/alertbox/20030908.html"><u><font color=#0000ff>usability misconceptions</font></u></a>.
<p>Three-day camp teaching <a class=new title="Tutorial description and course outline" href="http://www.nngroup.com/events/tutorials/camp.html"><u><font color=#0000ff>Usability in Practice</font></u></a> at the <a class=new title="Nielsen Norman Group: full conference program with detailed course descriptions of usability training tutorials" href="http://www.nngroup.com/events/"><u><font color=#0000ff>Usability Week 2008 conference</font></u></a> in San Francisco (June) and Melbourne (July). <!--
Full-day <a href="http://www.nngroup.com/events/tutorials/user_testing.html" title="Tutorial description and course outline" class="new">tutorial on user testing</a>
at the
<a href="http://www.nngroup.com/events/" title="Conference program and list of usability training tutorials" class="new">User Experience 2007 conference</a> in Las Vegas and Barcelona.
--></p>
</div>
<img src ="http://www.cppblog.com/ztwaker/aggbug/58837.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-08-14 13:44 <a href="http://www.cppblog.com/ztwaker/archive/2008/08/14/58837.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Why Free Software has poor usability, and how to improve it(ZT)</title><link>http://www.cppblog.com/ztwaker/archive/2008/08/14/58836.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Thu, 14 Aug 2008 05:40:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/08/14/58836.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/58836.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/08/14/58836.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/58836.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/58836.html</trackback:ping><description><![CDATA[<div id=header>
<div id=headerimg>
<h1><a href="http://mpt.net.nz/"><font color=#0000ff><u>Matthew Paul Thomas</u></font></a></h1>
<div class=description><font color=#0000ff><u></u></font></div>
</div>
</div>
<font color=#0000ff><u>
<hr>
</u></font>
<div class=widecolumn id=content>
<div class=post>
<h2 id=post-69><a title="Permanent Link: Why Free Software has poor usability, and how to improve it" href="http://mpt.net.nz/archive/2008/08/01/free-software-usability" rel=bookmark><u>Why Free Software has poor usability, and how to improve it</u></a></h2>
<div class=entrytext>
<p>When I wrote the first version of this article six years ago, I called it &#8220;<a href="http://web.archive.org/web/20030201183139/http://mpt.phrasewise.com/discuss/msgReader$173"><u><font color=#0000ff>Why Free Software usability tends to suck</font></u></a>&#8221;. The best open source applications and operating systems are more usable now than they were then. But this is largely from slow incremental improvements, and low-level competition between projects and distributors. Major problems with the design process itself remain largely unfixed.</p>
<p>Many of these problems are with <em>volunteer</em> software in general, not Free Software in particular. Hobbyist proprietary programs are often hard to use for many of the same reasons. But the easiest way of getting volunteers to contribute to a program is to make it open source. And while thousands of people are now employed in developing Free Software, most of its developers are volunteers. So it&#8217;s in Free Software that we see volunteer software&#8217;s usability problems most often.</p>
<p>That gives us a clue to our first two problems.</p>
<ol>
    <li id=incentives>
    <p><strong>Weak incentives for usability.</strong> Proprietary software vendors typically make money by producing software that people want to use. This is a strong incentive to make it more usable. (It doesn&#8217;t always work: for example, Microsoft, Apple, and Adobe software sometimes becomes worse but remains dominant through network effects. But it works most of the time.)</p>
    <p>With volunteer projects, though, any incentive is much weaker. The number of users rarely makes any financial difference to developers, and with freely redistributable software, it&#8217;s near-impossible to count users anyway. There are other incentives — impressing future employers, or getting your software included in a popular OS — but they&#8217;re rather oblique.
    <p>Solutions: Establish more and stronger incentives. For example, annual Free Software design awards could publicize and reward developers for good design. Software distributors could publish statistics on how many of their users use which programs, and how that number is changing over time. A bounty system could let people pay money in escrow for whoever implements a particular usability improvement. And distributed version control could foster quicker competition: distributors could choose not just which application to ship, but also which variant branch of an application, with usability as a factor in their choice.</p>
    <li id=designers>
    <p><strong>Few good designers.</strong> Some musicians are also great composers, but most aren&#8217;t. Some programmers are also great designers, but most aren&#8217;t. Programming and human interface design are separate skills, and people good at both are rare. So it&#8217;s important for software to have dedicated designers, but few Free Software projects do. Some usability specialists are employed by Free Software vendors such as Mozilla, Sun, Red Hat, and Canonical. But there aren&#8217;t many, and skilled <em>volunteer</em> designers are even harder to find.</p>
    <p>Solutions: Provide highly accessible training materials for programmers, and volunteer designers, to improve the overall level of design competence. Foster communities that let programmers collaborate with usability specialists. And encourage Free Software projects to have a lead programmer, a lead human interface designer, a help editor, and a QA engineer, these being separate people.</p>
    </li>
</ol>
<p>But why is there a shortage of volunteer designers in the first place? That brings us to the third problem.</p>
<ol start=3>
    <li id=suggestions>
    <p><strong>Design suggestions often aren&#8217;t invited or welcomed.</strong> Free Software has a long and healthy tradition of &#8220;show me the code&#8221;. But when someone points out a usability issue, this tradition turns into &#8220;patches welcome&#8221;, which is unhelpful since most designers aren&#8217;t programmers. And it&#8217;s not obvious how else usability specialists should help out.</p>
    <p>Solution: Establish a process for usability specialists to contribute to a project. For example, the lead designer could publish design specifications on the project&#8217;s Web site, and invite feedback on a Weblog, wiki, or mailing list. The designer could respond courteously to design suggestions (even the misguided ones). And the project maintainer could set up an editable issue tracker, instead of an append-only bug tracker — making it easy to refine, approve or decline, and prioritize implementation of design suggestions in the same way as bug reports.</p>
    </li>
</ol>
<p>So why do programmers respond differently to usability suggestions than to more technical bug reports?</p>
<ol start=4>
    <li id=measurement>
    <p><strong>Usability is hard to measure.</strong> Some qualities of software are easily and precisely measured: whether it runs at all, how fast it starts, how fast it runs, and whether it is technically correct.</p>
    <p>But these are only partial substitutes for more important qualities that are harder to measure: whether the software is useful, how responsive it feels, whether it behaves as people expect, what proportion of people succeed in using it, how quickly they can use it, and how satisfied they are when they&#8217;re finished.</p>
    <p>These human-related qualities can often be measured in user tests. But doing that takes hours or days that volunteers are unwilling to spend. User tests are usually low-resolution, picking up the big problems, but leaving designers without hard evidence to persuade programmers of the small problems. And even once a problem is identified, a solution needs to be designed, and that may need testing too.</p>
    <p>Without frequent user testing, volunteer projects rely on subjective feedback from the sort of people devoted enough to be subscribed to a project mailing list. But what these people say may not be representative of even their own actual behavior, let alone the behavior of users in general.</p>
    <p>Solutions: Promote small-scale user testing techniques that are practical for volunteers. Develop and promote screen capture, video recording, and other software that makes tests easier to run. Encourage developers to trust user test results more than user opinions. And write design guidelines that give advice on the common small problems that user tests won&#8217;t catch.</p>
    </li>
</ol>
<p>The lack of dedicated designers, in turn, contributes to three cultural problems in Free Software projects.</p>
<ol start=5>
    <li id=backwards>
    <p><strong>Coding before design.</strong> Software tends to be much more usable if it is, at least roughly, designed before the code is written. The desired human interface for a program or feature may affect the data model, the choice of algorithms, the order in which operations are performed, the need for threading, the format for storing data on disk, and even the feature set of the program as a whole. But doing all that wireframing and prototyping seems boring, so a programmer often just starts coding — they&#8217;ll worry about the interface later.</p>
    <p>But the more code has been written, the harder it is to fix a design problem — so programmers are more likely not to bother, or to convince themselves it isn&#8217;t <em>really</em> a problem. And if they finally fix the interface after version 1.0, existing users will have to relearn it, frustrating them and encouraging them to consider competing programs.</p>
    <p>Solution: Pair up designers with those programmers wanting to develop a new project or a new feature. Establish a culture in Free Software of design first, code second.</p>
    <li id=cooks>
    <p><strong>Too many cooks.</strong> In the absence of dedicated designers, many contributors to a project try to contribute to human interface design, regardless of how much they know about the subject. And multiple designers leads to inconsistency, both in vision and in detail. The quality of an interface design is inversely proportional to the number of designers.</p>
    <p>Solution: Projects could have a lead human interface designer, who fields everyone else&#8217;s suggestions, and works with the programmers in deciding what is implementable. And more detailed design specifications and guidelines could help prevent programmer-specific foibles.</p>
    <li id=tail-lights>
    <p><strong>Chasing tail-lights.</strong> In the absence of a definite design of their own, many developers assume that whatever Microsoft or Apple have done is good design. Sometimes it is, but sometimes it isn&#8217;t. In imitating their designs, Free Software developers repeat their mistakes, and ensure that they can never have a <em>better</em> design than the proprietary alternatives.</p>
    <p>Solution: Encourage innovative design through awards and other publicity. Update design guidelines, where appropriate, to reflect the results of successful design experiments.</p>
    </li>
</ol>
<p>Other reasons for poor usability exist regardless of the presence of dedicated designers. These problems are more difficult to solve.</p>
<ol start=8>
    <li id=itch>
    <p><strong>Scratching their own itch.</strong> Volunteer developers work on projects and features they are interested in, which usually means software that they are going to use themselves. Being software developers, they&#8217;re also power users. So software that&#8217;s supposed to be for general use ends up overly geeky and complicated. And features needed more by new or non-technical users — such as parental controls, a setup assistant, or the ability to import settings from competing software — may be neglected or not implemented at all.</p>
    <p>Solutions: Establish a culture of simplicity, by praising restrained design and ridiculing complex design. And encourage volunteer programmers to watch their friends and families using the software, inspiring them to fix problems that other people have.</p>
    <li id=details>
    <p><strong>Leaving little things broken.</strong> Many of the small details that improve a program&#8217;s interface are not exciting or satisfying to work on. Details like setting a window&#8217;s most appropriate size and position the first time it opens, focusing the appropriate control by default when a window opens, fine-tuning error messages and other text to be more helpful, or making a progress bar more accurately reflect overall progress. Because these things aren&#8217;t exciting or satisfying, often years go by before they get fixed. This gives users a general impression of poor design, and that may in turn discourage usability specialists from contributing.</p>
    <p>Solution: When scheduling bug fixes, take into account how long they will take, possibly scheduling minor interface fixes earlier if they can be done quickly. Involve interface designers in this scheduling, to guard against usability flaws being downplayed because &#8220;it&#8217;s just a UI issue&#8221;.</p>
    <li id=options>
    <p><strong>Placating people with options.</strong> In any software project with multiple contributors, sometimes they will disagree on a design issue. Where the contributors are employees, usually they&#8217;ll continue work even if they disagree with the design. But with volunteers, it&#8217;s much more likely that the project maintainer will agree to placate a contributor by adding a configuration setting for the behavior in question. The number, obscurity, and triviality of such preferences ends up confusing ordinary users, while everyone is penalized by the resulting bloat and reduced thoroughness of testing.</p>
    <p>Solution: Strong project maintainers and a culture of simplicity. Distributed version control may help relieve the pressure, too, by making it easier for someone to maintain their own variant of the software with the behavior they want.</p>
    <li id=fame>
    <p><strong>Fifteen pixels of fame.</strong> When a volunteer adds a new feature to a popular application, it is understandable for them to want recognition for that change — to be able to point to something in the interface and say &#8220;I did that&#8221;. Sometimes this results in new options or menu items for things that should really have no extra interface. Conversely, removing confusing or unhelpful features may draw the ire of the programmers who first developed them.</p>
    <p>Solutions: Provide alternative publicity, such as a Weblog, for crediting contributors. Establish design review of code changes that affect the human interface. Regularly review the entire interface, asking &#8220;Do we really need this bit&#8221;.</p>
    <li id=bandwidth>
    <p><strong>Design is high-bandwidth, the Net is low-bandwidth.</strong> Volunteer software projects are usually highly distributed, with contributors in different cities or even different continents. So project communications are mostly plain text, in e-mail, instant messaging, IRC, or a bug tracking system. But interaction design is multi-dimensional, involving the layout and behavior of elements over time, and the organization of those elements in an overall interface.</p>
    <p>When developers are in the same room, they can discuss interaction design using whiteboards, paper prototypes, spoken words, and gestures. But on the Internet, these often aren&#8217;t available, making discussions much slower and prone to misunderstandings.</p>
    <p>Solutions: Develop and promote VoIP, video chat, virtual whiteboard, sketching, and animation software that allows easier communication of design ideas over the Internet. And whenever possible, hold physical meetings for developers to collaborate in person.</p>
    </li>
</ol>
<p>Finally, a few problems are specific to Free Software development.</p>
<ol start=13>
    <li id=release-early>
    <p><strong>Release early, release often, get stuck.</strong> The common practice of &#8220;release early, release often&#8221; can cause poor design to accumulate. When a pre-release version behaves a particular way, and testers get used to it behaving that way, they will naturally complain when a later pre-release version behaves differently — even if the new behavior is better overall. This can discourage programmers from improving the interface, and can contribute to the increase in weird configuration settings.</p>
    <p>Solution: Publish design specifications as early as possible in the development process, so testers know what to expect eventually.</p>
    <li id=modularity>
    <p><strong>Mediocrity through modularity.</strong> Free software hackers prize code reuse. Often they talk of writing code to perform a function, so that other programmers can write a &#8220;front end&#8221; (or multiple alternative &#8220;front ends&#8221;) to let humans actually use it. They consider it important to be able to swap out any layer of the system in favor of alternative implementations.</p>
    <p>This is good for the long-term health of a system, because it avoids relying on any single component. But it also leads to a lack of integration which lessens usability, especially if the interfaces between the layers weren&#8217;t designed with usability in mind.</p>
    <p>For example, most terminal commands do not provide information on how complete a process is, or estimate how much time is remaining. This is traditional behavior in a terminal, but in graphical software, progress feedback is crucial. If a graphical utility is developed merely as a &#8220;front end&#8221; to the terminal command, it can&#8217;t easily provide that feedback.</p>
    <p>Solution: Design an example graphical interface first, so that interface requirements for the lower levels are known before they are written.</p>
    <li id=gated><strong>Gated development communities.</strong> When you do anything on a computer system you are relying on software from several different development teams. For example, if you print this Web page to show someone else, that task will involve not just the Web browser, but also a layout engine, a window manager, an interface toolkit, a variety of other libraries, a graphical subsystem, a printing subsystem, a printer driver, a filesystem, and a kernel, almost all of these implemented by separate teams.
    <p>&#160;</p>
    <p>Oten these teams don&#8217;t communicate with each other frequently. And unlike their proprietary competitors, they nearly all have different release cycles. This makes usability improvements difficult and slow to implement, if those improvements involve coordinating changes across multiple parts of the system.</p>
    <p>Solutions: Free Software system vendors can coordinate cross-component features like this, if they have employees working on all relevant levels of the software stack. And volunteer contributors to different software layers can meet at conferences arranged for that purpose. </p>
    </li>
</ol>
<p>That&#8217;s a long list of problems, but I think they&#8217;re all solvable. In the coming months I&#8217;ll discuss examples of each of the solutions, and what I&#8217;m doing personally to help make Free Software a success.</p>
<h2>Further reading</h2>
<ul>
    <li>&#8220;<a href="http://firstmonday.org/Issues/issue8_1/nichols/"><u><font color=#0000ff>The usability of open source software</font></u></a>&#8221; by David M. Nichols and Michael B. Twidale
    <li>&#8220;<a href="http://daringfireball.net/2004/04/spray_on_usability"><u><font color=#0000ff>Ronco spray-on usability</font></u></a>&#8221; by John Gruber </li>
</ul>
</div>
</div>
</div>
<img src ="http://www.cppblog.com/ztwaker/aggbug/58836.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-08-14 13:40 <a href="http://www.cppblog.com/ztwaker/archive/2008/08/14/58836.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Email相关协议-SMTP</title><link>http://www.cppblog.com/ztwaker/archive/2008/08/11/58486.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Mon, 11 Aug 2008 01:48:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/08/11/58486.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/58486.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/08/11/58486.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/58486.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/58486.html</trackback:ping><description><![CDATA[<font color=#ff0000><font style="BACKGROUND-COLOR: #cce8cf" color=#000000>来自：</font><a href="http://www.cnpaf.net/Class/SMTP/0532918532645032.html">http://www.cnpaf.net/Class/SMTP/</a><br><br><strong>SMTP协议简介</strong></font><br>SMTP被用来在因特网上传递电子邮件。文件RFC821规定了该协议的所有细节。但是你只须记住下面的内容－－该协议的基本命令和方法就行了。<br><br>　　协议的原理很简单。无非是一个客户端计算机向服务器发送命令，然后服务器向客户端计算机返回一些信息。客房端发送的命令以及服务器的回应都是字符串，你并不需要特别的软件就能读出它们。如果你仔细看过WinsockTerminal示例程序的源代码，你就会发现这一点。现在让我们用这个示例程序来向自己发一封电子邮件吧。<br><br>　　运行示例程序，单击"Connect"按钮，在"Connectto..."对话框中输入你的电子邮件服务器的地址，选择SMTP选项。最后按"Connect"按钮。如果连接成功，Winsock控件会产生Connected事件，在状态栏中也可看到连接成功的信息。在主文本窗口中你将看到从服务器返回的文本。该文本包含一个三位数的代码及描述，例如：<br><br>　　220-ns.cinfo.ruSendmail8.6.12/8.6.9readyatWed,22Apr199822:54:41+0300<br>　　220ESMTPspokenhere<br><br>　　不必太过留意这些描述。因为这些描述可能会因服务器而异。你只须要知道代码所代表的意思就行了。代码220表示成功建立连接，服务器等待你的第一个命令。<br><br>　　向服务器传递的第一个命令是HELO.该命令包含一个参数，即你的邮箱名。<br><br>　　HELOoleg<br><br>　　注意:在RFC821中，HELO是一个可选择性命令，如果服务器不要求该命令的话，你可以把它忽略掉。<br><br>　　如果命令成功，服务器会返回一个代码为250的回应。下一步用MAILFROM命令告诉服务器你想发一封邮件。该命令以发信人的邮件地址为参数。<br><br>　　MAILFROM:oleg@vbip.com<br><br>　　发完命令后，如果服务器返回一个代码为250回应，你就可以向服务器发送RCPTTO命令了。该命令以收信人地址为参数，一看便知是告诉服务器你想将邮件发到收信人地址处。<br><br>　　RCPTTO:somebody@domain.com<br><br>　　如果你想将邮件发给多个收件人的话。你需要多次使用RCPTTO命令，对每个命令，服务器都会返回代码为250的回应。<br><br>　　现在你可以向服务器发送邮件正文了。用DATA命令告诉服务器以下的内容为邮件正文。在你从服务器收到代码为354的回应后，你就可以发送邮件正文了。邮件按行发送，每行邮件以一个无回车的换行符结束（在VB中就是vbLf）示例程序知道何时使用换行符，何时使用回车加换行符。所以你只须按回车键就行了。下面是一个例子：<br><br>　　Subject:Myfirste-mailmessage.<br><br>　　　Firstlineofamessage.<br>　　　Secondline.<br>　　　.<br><br>　　注意上面最后一行的最后一个字符是一个小数点。这是正文结束的标志。用VB代码表示就是vbLf&amp;"."&amp;vbCrLf.服务器收到这个标志后，就会立即向你返回一个代码为250的回应以及该邮件的唯一ID号。<br><br>　　250WAA10568Messageacceptedfordelivery<br><br>　　任务完成了，你可以继续发送下封邮件，也可以断开同服务器的连接。如果要断开同服务器的连接就用QUIT命令。在这种情况下，服务器会返回一个代码为221的回应并断开连接。<br><br>　　QUIT<br><br>　　221ns.cinfo.ruclosingconnection<br><br>－－－－－－－－－－－<br>SMTP协议是TCP/IP协议族中的一员，主要对如何将电子邮件从发送方地址传送到接收方地址，也即是对传输的规则做了规定。SMTP协议的通信模型并不复杂，主要工作集中在发送SMTP和接收SMTP上：首先针对用户发出的邮件请求，由发送SMTP建立一条连接到接收SMTP的双工通讯链路，这里的接收SMTP是相对于发送SMTP而言的，实际上它既可以是最终的接收者也可以是中间传送者。发送SMTP负责向接收SMTP发送SMTP命令，而接收SMTP则负责接收并反馈应答。可大致用下面的通讯模型示意图来表示：<br>
<p align=center><img src="http://www.cnpaf.net/article/Files/RoUpimages/2115518477.gif" border=0><br></p>
－－－－－－－<br><strong><font color=#ff0000>SMTP协议原始命令码和工作原理</font></strong><br>1.SMTP是工作在两种情况下：一是电子邮件从客户机传输到服务器；二是从某一个服务器传输到另一个<br>服务器<br>2.SMTP是个请求/响应协议，命令和响应都是基于ASCII文本，并以CR和LF符结束。响应包括一个表示返<br>回状态的三位数字代码<br>3.SMTP在TCP协议25号端口监听连接请求<br>4.连接和发送过程：<br><br>a.建立TCP连接<br>b.客户端发送HELO命令以标识发件人自己的身份，然后客户端发送MAIL命令<br>服务器端正希望以OK作为响应，表明准备接收<br>c.客户端发送RCPT命令，以标识该电子邮件的计划接收人，可以有多个RCPT行<br>服务器端则表示是否愿意为收件人接受邮件<br>d.协商结束，发送邮件，用命令DATA发送<br>e.以.表示结束输入内容一起发送出去<br>f.结束此次发送，用QUIT命令退出。<br><br><br>5.另外两个命令：<br>VRFY---用于验证给定的用户邮箱是否存在，以及接收关于该用户的详细信息。<br>EXPN---用于扩充邮件列表。<br><br>6.邮件路由过程：<br>SMTP服务器基于&#8216;域名服务DNS中计划收件人的域名来路由电子邮件。SMTP服务器基于DNS中的MX记录<br>来路由电子邮件，MX记录注册了域名和相关的SMTP中继主机，属于该域的电子邮件都应向该主机发送。<br><br>若SMTP服务器mail.abc.com收到一封信要发到shuser@sh.abc.com:<br><br>a.Sendmail请求DNS给出主机sh.abc.com的CNAME记录，如有，假若CNAME到shmail.abc.com，则再次<br>请求shmail.abc.com的CNAME记录，直到没有为止<br>b.假定被CNAME到shmail.abc.com,然后sendmail请求@abc.com域的DNS给出shmail.abc.com的MX记录，<br>shmailMX5shmail.abc.com<br>10shmail2.abc.com<br>c.Sendmail最后请求DNS给出shmail.abc.com的A记录，即IP地址，若返回值为1.2.3.4<br>d.Sendmail与1.2.3.4连接，传送这封给shuser@sh.abc.com的信到1.2.3.4这台服务器的SMTP后台程序<br><br>7.SMTP基本命令集：<br><br>命令描述<br>------------------------------<br>HELO向服务器标识用户身份<br>发送者能欺骗，说谎，但一般情况下服务器都能检测到。<br><br>MAIL初始化邮件传输<br>mailfrom:<br>RCPT标识单个的邮件接收人；常在MAIL命令后面<br>可有多个rcptto:<br>DATA在单个或多个RCPT命令后，表示所有的邮件接收人已标识，并初始化数据传输，以.结束。<br>VRFY用于验证指定的用户/邮箱是否存在；由于安全方面的原因，服务器常禁止此命令<br>EXPN验证给定的邮箱列表是否存在，扩充邮箱列表，也常被禁用<br>HELP查询服务器支持什么命令<br>NOOP无操作，服务器应响应OK<br>QUIT结束会话<br>RSET重置会话，当前传输被取消<br>--------------------------------<br><br>8.MAILFROM命令中指定的地址是称作envelopefrom地址，不需要和发送者自己的地址是一致的。<br>RCPTTO与之等同，指明的接收者地址称为envelopeto地址，而与实际的to：行是什么无关。<br>9.为什么没有RCPTCC和RCPTBCC<br>所有的接收者协商都通过RCPTTO命令来实现，如果是BCC，则协商发送后在对方接收时被删掉信封接收者<br>10.邮件被分为信封部分，信头部分和信体部分<br>envelopefrom,envelopeto与messagefrom:,messageto:完全不相干。<br>evnelope是由服务器主机间SMTP后台提供的，而messagefrom/to是由用户提供的。有无冒号也是区别。<br><br>11.怎样由信封部分检查是否一封信是否是伪造的？<br>a.received行的关联性。<br>现在的SMTP邮件传输系统，在信封部分除了两端的内部主机处理的之个，考虑两个公司防火墙之间<br>的部分，若两台防火墙机器分别为Ａ和Ｂ，但接收者检查信封received：行时发现经过了C.则是伪造的。<br>b.received：行中的主机和IP地址对是否对应如：<br>Receibed:fromgalangal.org(turmeric.com[104.128.23.115]bymail.bieberdorf.edu....<br>c.被人手动添加在最后面的received行：<br>Received:fromgalangal.org([104.128.23.115])bymail.bieberdorf.edu(8.8.5)<br>Received:fromlemongrass.orgbygalangal.org(8.7.3)<br>Received:fromgraprao.combylemongrass.org(8.6.4)<br>－－－－－－－－<br><strong><font color=#ff0000>SMTP协议的命令和应答</font></strong><br>从前面的通讯模型可以看出SMTP协议在发送SMTP和接收SMTP之间的会话是靠发送SMTP的SMTP命令和接收SMTP反馈的应答来完成的。在通讯链路建立后，发送SMTP发送MAIL命令指令邮件发送者，若接收SMTP此时可以接收邮件则作出OK的应答，然后发送SMTP继续发出RCPT命令以确认邮件是否收到，如果接收到就作出OK的应答，否则就发出拒绝接收应答，但这并不会对整个邮件操作造成影响。双方如此反复多次，直至邮件处理完毕。SMTP协议共包含10个SMTP命令，列表如下：<br><br>SMTP命令命令说明<br>HELLO＜domain＞＜CRLF＞识别发送方到接收SMTP的一个HELLO命令<br>MAILFROM:＜reverse-path＞＜CRLF＞＜reverse-path＞为发送者地址。此命令告诉接收方一个新邮件发送的开始，并对所有的状态和缓冲区进行初始化。此命令开始一个邮件传输处理，最终完成将邮件数据传送到一个或多个邮箱中。<br>RCPTTO:＜forward-path＞＜CRLF＞＜forward-path＞标识各个邮件接收者的地址<br>DATA＜CRLF＞<br>接收SMTP将把其后的行为看作邮件数据去处理，以＜CRLF＞.＜CRLF＞标识数据的结尾。<br>REST＜CRLF＞退出/复位当前的邮件传输<br>NOOP＜CRLF＞要求接收SMTP仅做OK应答。（用于测试）<br>QUIT＜CRLF＞要求接收SMTP返回一个OK应答并关闭传输。<br>VRFY＜string＞＜CRLF＞验证指定的邮箱是否存在，由于安全因素，服务器多禁止此命令。<br>EXPN＜string＞＜CRLF＞验证给定的邮箱列表是否存在，扩充邮箱列表，也常禁止使用。<br>HELP＜CRLF＞查询服务器支持什么命令<br><br>注：＜CRLF＞为回车、换行，ASCII码分别为13、10（十进制）。<br><br>　　SMTP协议的每一个命令都会返回一个应答码，应答码的每一个数字都是有特定含义的，如第一位数字为2时表示命令成功；为5表失败；3表没有完成。一些较复杂的邮件程序利用该特点，首先检查应答码的首数字，并根据其值来决定下一步的动作。下面将SMTP的应答码列表如下：<br><br>应答码说明<br>501参数格式错误<br>502命令不可实现<br>503错误的命令序列<br>504命令参数不可实现<br>211系统状态或系统帮助响应<br>214帮助信息<br>220＜domain＞服务就绪<br>221＜domain＞服务关闭<br>421＜domain＞服务未就绪，关闭传输信道<br>250要求的邮件操作完成<br>251用户非本地，将转发向＜forward-path＞<br>450要求的邮件操作未完成，邮箱不可用<br>550要求的邮件操作未完成，邮箱不可用<br>451放弃要求的操作；处理过程中出错<br>551用户非本地，请尝试＜forward-path＞<br>452系统存储不足，要求的操作未执行<br>552过量的存储分配，要求的操作未执行<br>553邮箱名不可用，要求的操作未执行<br>354开始邮件输入，以"."结束<br>554操作失败<br>－－－－－－－－<br><br><br><br><br><br><br><br><br>
<img src ="http://www.cppblog.com/ztwaker/aggbug/58486.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-08-11 09:48 <a href="http://www.cppblog.com/ztwaker/archive/2008/08/11/58486.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Open Source Licenses by Category</title><link>http://www.cppblog.com/ztwaker/archive/2008/08/04/57945.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Mon, 04 Aug 2008 03:57:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/08/04/57945.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/57945.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/08/04/57945.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/57945.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/57945.html</trackback:ping><description><![CDATA[<h2>Open Source Licenses by Category</h2>
<p>from: <a href="http://www.opensource.org/licenses/category">http://www.opensource.org/licenses/category</a></p>
<div class=node id=node-28><span class=submitted>Tue, 2006-09-19 08:43 — nelson</span>
<div class=content>
<table cellSpacing=1 cellPadding=3 width="100%" summary="" border=0>
    <tbody>
        <tr>
            <td bgColor=#40aa54>&nbsp;<span class=title>.:: <strong>License Index</strong> ::.</span> </td>
        </tr>
        <tr>
            <td bgColor=#ffffff><a href="http://www.opensource.org/approval"><u><font color=#0000ff>License Approval Process</font></u></a> <br><a href="http://www.opensource.org/licenses"><u><font color=#800080>License Information</font></u></a> <br>Origins and definitions of <a href="https://osi.osuosl.org/wiki/help/proliferation"><u><font color=#0000ff>categories</font></u></a> from the License Proliferation Committee <a href="http://www.opensource.org/proliferation-report"><u><font color=#0000ff>report</font></u></a> </td>
        </tr>
        <tr>
            <td bgColor=#40aa54>&nbsp;<span class=title>.:: <strong>Licenses that are popular and widely used or with strong communities</strong> ::.</span> </td>
        </tr>
        <tr>
            <td bgColor=#ffffff>*<a href="http://www.opensource.org/licenses/apache2.0.php"><u><font color=#0000ff>Apache License, 2.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/bsd-license.php"><u><font color=#0000ff>New and Simplified BSD licenses</font></u></a> <br>*<a href="http://www.opensource.org/licenses/gpl-license.php"><u><font color=#800080>GNU General Public License (GPL)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/lgpl-license.php"><u><font color=#800080>GNU Library or "Lesser" General Public License (LGPL)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/mit-license.php"><u><font color=#0000ff>MIT license</font></u></a> <br>*<a href="http://www.opensource.org/licenses/mozilla1.1.php"><u><font color=#0000ff>Mozilla Public License 1.1 (MPL)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/cddl1.php"><u><font color=#0000ff>Common Development and Distribution License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/cpl1.0.php"><u><font color=#0000ff>Common Public License 1.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/eclipse-1.0.php"><u><font color=#0000ff>Eclipse Public License</font></u></a> </td>
        </tr>
        <tr>
            <td bgColor=#40aa54>&nbsp;<span class=title>.:: <strong>Special purpose licenses</strong> ::.</span> </td>
        </tr>
        <tr>
            <td bgColor=#ffffff>*<a href="http://www.opensource.org/licenses/ecl1.php"><u><font color=#0000ff>Educational Community License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/nasa1.3.php"><u><font color=#0000ff>NASA Open Source Agreement 1.3</font></u></a> <br>*<a href="http://www.opensource.org/licenses/opengroup.php"><u><font color=#0000ff>Open Group Test Suite License</font></u></a> </td>
        </tr>
        <tr>
            <td bgColor=#40aa54>&nbsp;<span class=title>.:: <strong>Other/Miscellaneous licenses</strong> ::.</span> </td>
        </tr>
        <tr>
            <td bgColor=#ffffff>*<a href="http://www.opensource.org/licenses/apl1.0.php"><u><font color=#0000ff>Adaptive Public License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/artistic-license-2.0.php"><u><font color=#0000ff>Artistic license 2.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/osl-3.0.php"><u><font color=#0000ff>Open Software License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/qtpl.php"><u><font color=#0000ff>Qt Public License (QPL)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/zlib-license.php"><u><font color=#0000ff>zlib/libpng license</font></u></a> </td>
        </tr>
        <tr>
            <td bgColor=#40aa54>&nbsp;<span class=title>.:: <strong>Licenses that are redundant with more popular licenses</strong> ::.</span> </td>
        </tr>
        <tr>
            <td bgColor=#ffffff>*<a href="http://www.opensource.org/licenses/afl-3.0.php"><u><font color=#0000ff>Academic Free License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/attribution.php"><u><font color=#0000ff>Attribution Assurance Licenses</font></u></a> <br>*<a href="http://www.opensource.org/licenses/ver2_eiffel.php"><u><font color=#0000ff>Eiffel Forum License V2.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/fair.php"><u><font color=#0000ff>Fair License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/historical.php"><u><font color=#0000ff>Historical Permission Notice and Disclaimer</font></u></a> <br>*<a href="http://www.opensource.org/licenses/lucent1.02.php"><u><font color=#0000ff>Lucent Public License Version 1.02</font></u></a> <br>*<a href="http://www.opensource.org/licenses/UoI-NCSA.php"><u><font color=#0000ff>University of Illinois/NCSA Open Source License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/xnet.php"><u><font color=#0000ff>X.Net License</font></u></a> </td>
        </tr>
        <tr>
            <td bgColor=#40aa54>&nbsp;<span class=title>.:: <strong>Non-reusable licenses</strong> ::.</span> </td>
        </tr>
        <tr>
            <td bgColor=#ffffff>*<a href="http://www.opensource.org/licenses/apsl-2.0.php"><u><font color=#0000ff>Apple Public Source License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/ca-tosl1.1.php"><u><font color=#0000ff>Computer Associates Trusted Open Source License 1.1</font></u></a> <br>*<a href="http://www.opensource.org/licenses/cuaoffice.php"><u><font color=#0000ff>CUA Office Public License Version 1.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/eudatagrid.php"><u><font color=#0000ff>EU DataGrid Software License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/entessa.php"><u><font color=#0000ff>Entessa Public License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/frameworx.php"><u><font color=#0000ff>Frameworx License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/ibmpl.php"><u><font color=#0000ff>IBM Public License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/motosoto.php"><u><font color=#0000ff>Motosoto License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/multics.txt"><u><font color=#0000ff>Multics License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/naumen.php"><u><font color=#0000ff>Naumen Public License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/nethack.php"><u><font color=#0000ff>Nethack General Public License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/nokia.php"><u><font color=#0000ff>Nokia Open Source License</font></u></a> <br>* <a href="http://www.opensource.org/licenses/oclc2.php"><u><font color=#0000ff>OCLC Research Public License 2.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/php.php"><u><font color=#0000ff>PHP License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/pythonpl.php"><u><font color=#0000ff>Python license</font></u></a> (CNRI Python License)<br>*<a href="http://www.opensource.org/licenses/PythonSoftFoundation.php"><u><font color=#0000ff>Python Software Foundation License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/real.php"><u><font color=#0000ff>RealNetworks Public Source License V1.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/rpl.php"><u><font color=#0000ff>Reciprocal Public License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/ricohpl.php"><u><font color=#0000ff>Ricoh Source Code Public License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/sleepycat.php"><u><font color=#0000ff>Sleepycat License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/sunpublic.php"><u><font color=#0000ff>Sun Public License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/sybase.php"><u><font color=#0000ff>Sybase Open Watcom Public License 1.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/vovidapl.php"><u><font color=#0000ff>Vovida Software License v. 1.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/W3C.php"><u><font color=#0000ff>W3C License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/wxwindows.php"><u><font color=#0000ff>wxWindows Library License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/zpl.php"><u><font color=#0000ff>Zope Public License</font></u></a> </td>
        </tr>
        <tr>
            <td bgColor=#40aa54>&nbsp;<span class=title>.:: <strong>Superseded licenses</strong> ::.</span> </td>
        </tr>
        <tr>
            <td bgColor=#ffffff>*<a href="http://www.opensource.org/licenses/apachepl-1.1.php"><u><font color=#0000ff>Apache Software License 1.1</font></u></a><br>*<a href="http://www.opensource.org/licenses/artistic-license-1.0.php"><u><font color=#0000ff>Artistic license 1.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/ver1_eiffel.php"><u><font color=#0000ff>Eiffel Forum License V1.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/plan9.php"><u><font color=#0000ff>Lucent Public License (Plan9)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/mozilla1.0.php"><u><font color=#0000ff>Mozilla Public License 1.0 (MPL)</font></u></a> </td>
        </tr>
        <tr>
            <td bgColor=#40aa54>&nbsp;<span class=title>.:: <strong>Licenses that have been voluntarily retired</strong> ::.</span> </td>
        </tr>
        <tr>
            <td bgColor=#ffffff>*<a href="http://www.opensource.org/licenses/intel-open-source-license.php"><u><font color=#0000ff>Intel Open Source License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/jabberpl.php"><u><font color=#0000ff>Jabber Open Source License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/mitrepl.php"><u><font color=#0000ff>MITRE Collaborative Virtual Workspace License (CVW License)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/sisslpl.php"><u><font color=#0000ff>Sun Industry Standards Source License (SISSL)</font></u></a> <br></td>
        </tr>
        <tr>
            <td bgColor=#40aa54>&nbsp;<span class=title>.:: <strong>Uncategorized Licenses</strong> ::.</span> </td>
        </tr>
        <tr>
            <td bgColor=#ffffff>*<a href="http://www.opensource.org/licenses/agpl-v3.html"><u><font color=#0000ff>Affero GNU Public License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/bsl1.0.html"><u><font color=#0000ff>Boost Software License (BSL1.0)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/cpal_1.0"><u><font color=#0000ff>Common Public Attribution License 1.0 (CPAL)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/gpl-3.0.html"><u><font color=#0000ff>GNU General Public License version 3.0 (GPLv3)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/lgpl-3.0.html"><u><font color=#0000ff>GNU Library or "Lesser" General Public License version 3.0 (LGPLv3)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/isc-license.txt"><u><font color=#0000ff>ISC License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/ms-pl.html"><u><font color=#0000ff>Microsoft Public License (Ms-PL)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/ms-rl.html"><u><font color=#0000ff>Microsoft Reciprocal License (Ms-RL)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/NOSL-3.0.html"><u><font color=#0000ff>Non-Profit Open Software License 3.0</font></u></a> <br>*<a href="http://www.opensource.org/licenses/ntp-license.php"><u><font color=#0000ff>NTP License</font></u></a> <br>*<a href="http://www.opensource.org/licenses/rpl1.5.txt"><u><font color=#0000ff>Reciprocal Public License 1.5 (RPL1.5)</font></u></a> <br>*<a href="http://www.opensource.org/licenses/simpl-2.0.html"><u><font color=#0000ff>Simple Public License 2.0</font></u></a> <br></td>
        </tr>
    </tbody>
</table>
</div>
</div>
<img src ="http://www.cppblog.com/ztwaker/aggbug/57945.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-08-04 11:57 <a href="http://www.cppblog.com/ztwaker/archive/2008/08/04/57945.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Agile Development [ZT]</title><link>http://www.cppblog.com/ztwaker/archive/2008/08/04/57926.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Mon, 04 Aug 2008 01:18:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/08/04/57926.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/57926.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/08/04/57926.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/57926.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/57926.html</trackback:ping><description><![CDATA[<h2>
<h1><span class=ArticleTopTitle id=ctl00_ArticleTopHeader_ArticleTitle>Agile Development</span></h1>
<strong>By <a href="http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=5313110">John Graham-Cumming</a></strong><br><br><span class=ArticleTopDescr id=ctl00_ArticleTopHeader_ArticleDescr>Five Steps to Continuous Integration</span> </h2>
<h2>Introduction </h2>
<p>In this whitepaper I argue that the person most affected by the introduction of agile or extreme programming techniques is not the software or quality assurance engineer, but the build manager. And the build manager can no longer make do with home grown tools; software production automation tools are required to make agile development a build reality. </p>
<p>The reality is that agile techniques are a throwback to the age when developers were able to work on small projects in small teams. Each developer (or sometimes pair of developers) concentrates on small building blocks of code (with associated unit tests), and integrates regularly with other developers to ensure that the overall software project is progressing. For developers, agile techniques are a natural fit because they reflect how developers like to work best: on small, manageable pieces of code with regular feedback. </p>
<p>Even though developers are working on small sections of code, the overall projects they are part of are now very large. So there's no going back to a small build on a single machine for build managers. While developers may have broken their work down into small units that they can code and test, the overall size of most enterprise software projects is constantly growing. And it's the large body of code that the build manager is expected to work with, not the manageable chunks that developers deal with. </p>
<p>In fact, the build manager is expected to cope with ever larger software, on ever more platforms, while at the same time dealing with developers' requests for fast integration builds. Those integration builds enable agile development at the software engineer's desktop because they are able to integrate their local changes into a large build, but cause build managers to be required to produce one or two orders of magnitude more builds per day. </p>
<h2>Continuous Integration </h2>
<p>To the build manager, the words "multiple integrations per day" and "each integration is verified by an automated build" mean a radical change from once-nightly builds. All these changes are brought about by one central tenet of agile development: continuous integration. </p>
<p>The seminal paper on Continuous Integration (and an excellent, and readable introduction to the topic) is Martin Fowler's article entitled, simply, "Continuous Integration" and is available <a href="http://www.codeproject.com/redir.aspx?id=6706"><u><font color=#0000ff>here</font></u></a>. </p>
<p>Its abstract states: </p>
<blockquote dir=ltr style="MARGIN-RIGHT: 0px">
<p>Continuous Integration is a software development practice where members of a team integrate their work frequently; usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. </p>
</blockquote>
<p>To the build manager, the words "multiple integrations per day" and "each integration is verified by an automated build" mean a radical change from once-nightly builds. </p>
<p>Fowler goes on to list a number of "Practices of Continuous Integration." The first build-related practice is "Automate the Build." He argues that the set of tasks required to go from source code to the final shipping binary is so complex that it should be automated so that it is repeatable. If the build is not automated, he argues, the build process will be error prone. </p>
<p>He also argues that the build includes much more than just compiling the software and building a binary. He sets the goal of, "anyone should be able to bring a virgin machine, check the sources out of the repository, issue a single command, and have a running system on their machine." </p>
<p>It's worth stopping and thinking about the implications of that statement for your build organization. It's very likely that getting to such an automated stage seems impossible, when starting from what is often a creaky build system held together by a collection of Makefiles, Perl scripts and other programs whose exact function or operation is often unclear. </p>
<p>Clearly, the goal of going from a virgin machine to fully running code is a stretch, but I think it's a good overall goal. Once you reach that stage, you will have put together a build system that is very reliable and should, if written and documented well, be easy to modify and adapt as software changes. </p>
<p>Such a fully automated build has advantages outside the direct realm of agile development. How many times has your build team been asked to rebuild an old version of your software and been unable to do so? Important customers can sometimes demand that old versions of code be patched or updated, or a security problem can mean that all versions of a company's currently supported code need to be fixed and released. </p>
<p>In general, only very well prepared teams are capable of building an arbitrary version of their code. Even if a good archive of the sources was made at the time of release, other components of software are likely to have decomposed: you may not have the right build scripts, or the right compiler, or the right version of some third-party component any more. </p>
<p>Fowler's goal, which I refer to as a "pickled build" (the entire build is pickled in a jar ready for use whenever demanded), done right, means that old versions of software can be rebuilt at will, and helps support developers in their move to agile development. </p>
<p>Fowler's second practice for builds is: "Make Your Build Self- Testing." This implies that the automatic build also includes an automatic test. He asks that any body of code have a set of automatic tests that can check a large part of the code base for bugs. Many developers are, in fact, already writing such test suites through the Extreme Programming focus on unit testing, or by performing Test Driven Development (where developers write the tests before the code). </p>
<p>With this test suite in place, Fowler asks that the automated build test itself by running the test suite and reporting the results. Results would typically be reported on screen or by email if the build and test was run remotely. </p>
<p>Fowler's next two practices have a profound effect on build management: "Everyone Commits Every Day" and "Every Commit Should Build the Mainline on an Integration Machine." The implication is that every developer will be committing code once per day (at least) and that every commit will cause a build and test on some build resource (the "integration machine") managed by the build manager. To put that in perspective, for a team of 20 engineers committing once per day during an 8 hour work day, that's a build and test every 24 minutes. For large teams that number increases, and the time between builds is greatly shorted. </p>
<p>The reason agile developers want these per-commit builds is to ensure that integration between developers is working and that the software being built works, and is testable, at all times. The idea that the software should run at all times is central to agile development, and the health of the per-commit build and test becomes an important sign of health for the entire project. If per-commit builds are done quickly and frequently enough, the build will reflect changes made by a single check-in by a single developer offering unparalleled opportunity to narrow down the cause of a breakage. </p>
<p>In fact, this build is so important that I refer to it as the Agile Heartbeat. Agile teams will install monitoring devices (such as red and green lava lamps) that make the status of the heartbeat build visible to all. Fowler states that no developer should "go home until the mainline build has passed with any commits" they've added. This means that all of engineering looks every day to the heartbeat to measure their own progress (Fowler refers to this in the practice "Everyone can see what's happening"). </p>
<p>Another important practice mentioned in Fowler's paper is 'Keep the Build Fast'. This seems like an obvious corollary to the previous practices, since a team that requires a build every few minutes and every time the code changes will necessarily need very fast builds. In fact, Extreme Programming outlines the goal of "ten minute" builds, and I've written previously about what I call espresso builds (builds that only take as long as a coffee break). </p>
<p>Fast builds are also important because developers are looking to the status of the build as a measure of their progress. Every minute that is shaved off the build is a minute saved for all developers who have committed code to that build. With many developers, and many builds, that time saved adds up quickly and fast builds improve the productivity of the entire team. </p>
<p>Fowler suggests that this entire process be either managed by hand (if the team is very small), or through the use of a "continuous integration server." This whitepaper will later describe tools that can be used to implement continuous integration, but first, the very idea of getting to continuous integration may seem daunting. Luckily, it can be broken down into stepping stones that are of a manageable size. </p>
<h2>Stepping Stones to Continuous Integration </h2>
<p>Although pickling your entire build system (getting the build under ten minutes, building every time a developer checks in and giving automatic feedback) is an enormous task, a stepping stone approach can get you to continuous integration without a single, painful push to change everything in the organization. </p>
<p>And, typically, build managers simply do not have the time or resources to spend on a major change to everything they do. This is especially true when build managers are, naturally, expected to keep churning out the builds that they currently create while improving their processes to meet the needs of agile development. </p>
<p>However, a five-stage approach can help ease the way to continuous integration. Those five stages are: fully automated builds, fast builds, lava lamps, build and test and pre-flight builds. At each stage, the build manager should carefully consider the tool available for automation of the software production process as continuous integration requires a very large effort. </p>
<h3>1. Fully Automate </h3>
<p>Although some builds are already fully automated, most require integration and agile builds is some manual intervention on the part of the build manager (for the ability to build your example, during the installation of the software when a dialog box software automatically needs clicking). But the core of continuous integration and agile builds is the ability to build your software automatically. </p>
<p>So the first stepping stone is to make the build runnable from a single command invocation (the build manager should simply be able to type <code>build</code> followed by some arguments specifying a particular branch or version of the software to build). Once that build script is in place, the build system should be set to run automatically. </p>
<p>This is mostly a matter of detecting when the source code in the source code management system has changed. One way to do that is to have a simple periodic job that checks for changes. Once changes are detected, the job then waits for the repository to stabilize (to give developers time to commit all their code). The job could then wait for a period of quiet for fifteen minutes following a commit. Once the quiet period has ended, the build system starts a full build and test using the build script to build from the main line of code. </p>
<p>This is probably the only stepping stone that can be performed without resorting to new software production management software. The build script can be written using existing tools (such as GNU Make or Perl), but it's worth looking at available automation tools (open source or commercial) since the detection of source code changes and kicking off of an automated build is a common feature. Getting started with a new tool in a limited way (just for the change detection and build kick off) is a good way to learn the tool without having committed to each of the five steps to continuous integration. </p>
<h3>2. Fast Builds </h3>
<p>Having automated the build, the next step is to speed up the builds themselves. Although Extreme Programming preaches a ten minute automated build and test, I think that a realistic goal for an existing project is to get the automated build and test under one hour. </p>
<p>With multi-core processors and multi-processor machines becoming commonplace, exploiting parallelism available in builds is a relatively simple way to achieve significant build speed-ups. However, missing or incomplete dependency information makes implementing a homegrown parallel build error-prone&#8230; </p>
<p>Getting to fast builds can be hard. </p>
<p>For some projects, it's simply a matter of upgrading from outmoded build hardware to newer machines (and often newer, faster disks since builds require a lot of disk access getting sources and writing objects), but for others the build will either require restructuring (so that it can be broken down into parts runnable on separate machines), or a purpose-built parallel build system will be needed. Parallel build systems are available as both open source and commercial products (including from <a href="http://www.codeproject.com/redir.aspx?id=6707"><u><font color=#800080>Electric Cloud</font></u></a>). With multi-core processors and multi-processor machines becoming commonplace, exploiting parallelism available in builds is a relatively simple way to achieve significant build speed-ups. However, missing or incomplete dependency information makes implementing a homegrown parallel build error-prone, and requires specialized tools to overcome the inherently serial nature of almost all large build systems. </p>
<h3>3. Lava Lamps </h3>
<p>Lava lamps (those bubbling colored liquid lamps popular in the 1970s) may seem like a silly way to monitor build progress, and in a physically large team (or with remote teams or a complex project) they may not actually be suitable, but introducing some sort of build monitoring is the third stepping stone. Lava lamps are just a fun, easy-to-implement example of a monitoring system. </p>
<p>A build monitor could be red and green lava lamps, or an internal web page showing live build status, or a flat screen monitor mounted high on the wall giving build status. Introduce a mechanism for build feedback that is clear (red and green for bad and good, for example), easily visible (perhaps those lava lamps are right by the water cooler) and continuously updated. </p>
<p>The build monitor will get its input (good or bad) from the fully automated builds set up in the first stepping stone. Everyone will look to the build monitor first thing in the morning and throughout the day as new builds are run. </p>
<p>Although the build may only run and give feedback a small number of times per day (perhaps as little as four times), the build monitor will start to represent the pulse of the engineering team, illustrating the health of the build and hence the software for all to see. This is another important step towards the goal of every commit initiating a build with results for all to see. </p>
<p>Even with just four builds a day with feedback, developers will be able to identify integration problems much quicker than with a nightly build. And with the automation effort expended in the first stepping stone, these automatic builds will be reliable and repeatable and a good indication of the software's health. </p>
<h3>4. Build and Test </h3>
<p>If developers are following agile methods, they'll be developing automated test suites using tools like jUnit or cppunit. The third stepping stone is to integrate these tests (and other "smoke tests" that may already exist) into the build system now in place. </p>
<p>This is probably a relatively simple task given that the tests themselves are already automatic. This step is also important because it will raise the visibility and importance of the builds, and becomes the start of the agile heartbeat. </p>
<h3>5. Pre-Flight Builds</h3>
<p>The primary need of developers practicing agile development is the ability to see that their code integrates with the changes made by other developers. Although they could do this on their local machine (by getting all the relevant sources and running a tool like Make), the integration build may take too long, or need special build resources to be able to construct every part of the software. Typically, that means that developers are forced to limit their builds to small parts of an overall project. Even if developers could run full builds on their machines, the production build environment is often different from the environments on developers&#8217; machines, so a build that works on a developer&#8217;s machine may not work in the production environment. Because of these issues, developers frequently introduce errors when they ultimately integrate with the complete system by checking in their code. </p>
<p>A good first step is to put full builds in the hands of developers. The build manager needs to assign a machine (or perhaps more than one if multiple platforms are involved) and set up an internal web page where a developer can request a build. </p>
<p>The developer's request should include their email address, the location of the software they want built (this could be the name of a branch to build, or a directory on a shared server where the developer has placed a personal copy of the source), and the opportunity to determine the extent of the build (for example, the developer could request a build on all platforms, or limit the build to just a single operating system). </p>
<p>The system should maintain a queue (visible through another internal web page) of pending build requests and should handle the builds in first-come, first-served order. When a developer's build has completed running (perhaps a couple of hours after their request), the developer receives an email giving the status of the build and any error output generated by the build system. </p>
<p>In addition, the build system takes the entire output of the build and stores it on a shared disk for the developer to examine. After some fixed period (perhaps a week), the output of the build is automatically deleted by the build system to free up space. </p>
<p>The advantages to the agile developer are immediate: they no longer have to wait for a nightly build (with the inherent 24-hour delay) to determine whether their changes broke anything, and by isolating the build to their sources, or their branch, they are able to much more quickly fix a problem even if their pre-flight build took many hours to complete, because they can narrow down the changed parts of the code more quickly. Furthermore, they can be confident that their check-in will not introduce environment-related build breakages, since the pre-flight build was run in the production environment. </p>
<p>At this point, the entire team can decide to introduce a new rule: no one commits to the mainline of source code control until they've run a successful pre-flight build. Here you've introduced another part of agile development which will greatly reduce the number of errors in the nightly builds. With developers checking their own code against a full build run through the pre-flight system before committing, they ensure that most integration errors are removed before affecting the entire team. </p>
<p>For the team, the great advantage of pre-flight builds is that the nightly or automated builds suddenly become more reliable. If developers are checking their code for breakages against a pre-flight build before checking in, the nightly build's reliability will increase greatly. For the build manager, there are two significant challenges to implementing pre-flight builds: automation and build resource availability. </p>
<p>The first prerequisite of an pre-flight build system is an automatic build, so tackling the first stepping stone is critical. It is, in fact, Fowler's first build-related practice and the cornerstone of continuous integration. The price of getting to a fully automated build (without automated tests at this stage) has to be paid up-front and will be the most expensive (in terms of time) part of the move to continuous integration. </p>
<p>Secondly, the internal web page needs to be written. This is relatively easy with free web servers (such as Apache), and free tools (such as PHP and Perl) being widely available and well documented. </p>
<p>Lastly, as developers start to use the system (and they will if they are trying to be agile), the number of available build machines will become a problem. As many developers begin to ask for preflight builds the build queue may become long (especially if the build time is also long). </p>
<p>At this point, the build manager has achieved agile builds. Developers can build whenever they need to; when code is checked in, it gets built automatically (and quickly) and everyone sees the state of that build. If the build breaks, developers can stop work to get the code integrating quickly. </p>
<p>The build manager may also choose to stop doing nightly builds altogether. With pre-flight and per check-in builds, the nightly build may be a thing of the past. </p>
<h2>Tools That Can Help</h2>
<p>A good starting point when searching for continuous integration tools is the Wikipedia page entitled "<a href="http://www.codeproject.com/redir.aspx?id=6708"><u><font color=#800080>Continuous Integration</font></u></a>." There you'll find a long list of commercial and open source tools for building continuous integration servers. </p>
<p>To preserve the team&#8217;s sanity and reduce downtime for developers and the build team when looking at tools or considering a build- versus-buy decision, you should aim to change as little as possible about your existing build environment. The goal should be to automate the build completely (so that it can be fired off from a single command) without changing the entire system. All that's needed to get continuous integration off the ground is a single command capable of running an entire build: the command needs to extract the sources from source code management and perform the build. </p>
<p>Once that script is in place, the choice of appropriate tool really comes down to a few key questions: </p>
<ol>
    <li>Does the tool support scheduled builds? If the tool can't support "cron" style builds then it's not worth considering. These are the most basic sort of builds and, even when you've introduced agile development methods, they'll still be important.
    <li>Is the tool scalable? One of the characteristics of agile development is that enormous loads will quickly be placed on build resources as engineers start running their own builds. And those resources will be even more stressed when every commit starts a build. Scalability needs to be considered from the start to avoid having to change servers in the middle of the stepping stones to continuous integration. Any tool must scale as resources (such as servers) are added, and be able to make use of pools of resources simultaneously as demand fluctuates throughout the work day. Business demands should be considered as well, as requirements for additional target platforms or integration of new teams will place additional demands upon the system over time.
    <li>Does the tool provide reporting or analytical tools? With hundreds of builds per day, managing the output or even just the status of every build is a headache. What was simple with a single nightly build becomes very hard with builds every ten minutes, and it's vital to be able to understand the performance of build systems and how the load and use of the build servers are changing over time.
    <li>Is the tool easy to adopt? Avoid any tool that requires rewriting existing Makefiles or build scripts: it's hard enough to adopt a new methodology without being required to start everything from scratch. The tool should work with existing tools and integrate with the existing source code management system.
    <li>Will the tool enable pre-flight and per-commit builds? Since these two styles of build are fundamental to continuous integration, the tool must make it easy to integrate with source code management to detect changes to the source base and automatically start builds, and to allow any user to start a build at will.
    <li>Does the tool support access control? Since the build servers will now be shared with all of development (and not with the small build team alone), access control is vital to ensure that developers have access to the appropriate resources from any location whether local or remote, and that the build team is able to override running builds to perform high-priority builds at will.
    <li>Will the tool support multiple teams or will each group or division require its own investment in a tool (plus configuration and maintenance)? Once automated, many build procedures (such as the job that monitors the source code management system for changes) will likely be generic in nature and easily shared across the organization. To maximize investment in a tool and reduce duplicate work, can common procedures or company standards be rolled out across teams? </li>
</ol>
<p>In many, if not all cases, a homegrown approach will fall short in one or more of these areas. Or, if the homegrown system is adequate at the outset of the stepping stones to continuous integration, it may fall short over time as the load increases, the number of target platforms increases or as the number of users increases. Commercial tools will also pay off in terms of the reduced administration and maintenance required of a manual setup. </p>
<h2>Conclusion </h2>
<p>Extreme Programming and Agile Development are being adopted by many software engineering organizations. Achieving agility is not easy, but teams can realize some of the benefits of agile development with a step-by-step approach. Careful planning is required by all parts of the engineering team with a special focus on the build resources. The build team will come under enormous pressure once agile methods are implemented and a step-by-step approach to implementing agile builds is recommended. </p>
<p>Careful selection of appropriate build tools is essential from the start of the roll-out of any agile method. Those tools must be able to cope with the varied demands on the build resources and with the likely growth in the number and size of builds. </p>
<h2>Enabling Agile Builds with ElectricCommander </h2>
<h3>Faster Builds, Automated Tests </h3>
<p>To maintain aggressive product release schedules, the LSI Logic Consumer Products engineering team wanted to move toward a daily integration model, integrating, building and testing 25 to 50 unique software builds every 24 hours. </p>
<p>The company first chose Electric Cloud&#8217;s ElectricAccelerator to address the build speed issues within the integration model, succeeding in reducing build times by 7-8x (from 150 minutes down to 20-30 minutes). </p>
<p>Seeing success with ElectricAccelerator, LSI decided to convert its test environment to ElectricCommander, Electric Cloud&#8217;s production automation solution. Where their previous environment became overloaded handling just 250 concurrent steps, ElectricCommander was able to schedule and execute more than 1,000 concurrent steps with the same hardware setup, dramatically streamlining and speeding the smoke test process. </p>
<p>ElectricCommander is a tool to consider for implementing an agile production process within an enterprise environment. It is a Web-based solution for automating software builds and other production tasks to enable agile, iterative development. Only ElectricCommander is simple enough to use on a small build, yet scalable enough to support the most complex software production environments. It requires minimal process changes to get started or to deploy across teams. It provides the reporting and visibility organizations need for compliance efforts and release planning, plus an unprecedented level of flexibility and customizability to suit the agile organization. For agile teams ElectricCommander enables: </p>
<ul>
    <li>Fast builds: Run multiple procedures in parallel on the same resource, or distribute procedures or individual steps across any number of machines for faster turnaround and more efficient production. For additional speed improvements to the build step, ElectricAccelerator provides a fine-grained parallelism to speed builds by as much as 20x (see below).
    <li>Automated and scheduled builds: Schedule production procedures to run at a specified day or time, on an hourly or daily basis, or whenever someone checks in code to a specified repository or branch.
    <li>Pre-flight and per-commit builds: The underlying information architecture allows build and release teams to organize production assets into virtual, access-controlled projects, while access to production machines can also be limited or controlled. In this way, a release team can provide developers with dedicated or specified resources for pre-flight builds, as needed. Further, ElectricCommander supports integrations with leading SCM tools to facilitate per-commit builds.
    <li>Visibility and reporting: ElectricCommander&#8217;s unique analytics provide valuable insight into the details of the build, not just success or failure. The analytics engine extracts information and stores it as persistent properties of the job step, providing easy access to pinpoint statistics and trend reporting. </li>
</ul>
<h3>About Electric Cloud </h3>
<p><a href="http://www.codeproject.com/redir.aspx?id=6707"><u><font color=#800080>Electric Cloud</font></u></a> is the leading provider of Software Production Management solutions that accelerate, automate and analyze the software development tasks that follow the check-in of new code. These include the software build, package, test and deploy processes. </p>
<p>The reality is that homegrown systems are expensive to maintain and difficult to standardize across an enterprise, and are typically not able to support the frequent iterations at the core of Agile Development. Electric Cloud makes it simple to achieve a scalable, agile software production environment across the organization. Electric Cloud's product suite &#8211; ElectricAccelerator, ElectricCommander and ElectricInsight &#8211; improves development productivity and product quality by accelerating, automating and analyzing the entire software production management lifecycle. In addition to the ElectricCommander production automation tool, Electric Cloud offers: </p>
<h4>ElectricAccelerator </h4>
<p>ElectricAccelerator&#8482; accurately executes parallel builds across a cluster of inexpensive servers to reduce build times by as much as 20x. ElectricAccelerator plugs seamlessly into existing build infrastructures, without modifying existing scripts. Faster, more accurate builds dramatically reduce the time developers spend waiting for builds to complete, and enable them to do complete builds before checking in their changes. </p>
<h4>ElectricInsight </h4>
<p>ElectricInsight&#8482; is a software build visualization tool that, when used in conjunction with ElectricAccelerator, provides job-level detail into parallel builds and provides unprecedented visibility into build results for simplified troubleshooting and performance tuning. Leading companies such as Qualcomm, Intuit, Motorola, and Expedia have trusted Electric Cloud&#8217;s Software Production Management solutions to change software builds and the entire production process from a liability to a competitive advantage. </p>
<!-- Article Ends --><!-- Main Page Contents End -->
<form id=aspnetForm style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px" name=aspnetForm action=AgileDevelopment.aspx method=post>
    <div><input id=__VIEWSTATE type=hidden value=/wEPDwULLTEwMDUyNjYzMjhkZNrXepIS20TzI0sfl4U/MKYE3EAo name=__VIEWSTATE> </div>
    <h2>License</h2>
    <div id=ctl00_LicenseTerms>
    <p>This article, along with any associated source code and files, is licensed under <a href="http://www.codeproject.com/info/cpol10.aspx"><u><font color=#0000ff>The Code Project Open License (CPOL)</font></u></a></p>
    </div>
    <h2>About the Author</h2>
    <table cellSpacing=5 cellPadding=0 width="100%" border=0>
        <tbody>
            <tr vAlign=top>
                <td id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberPhotoTable style="WIDTH: 155px" vAlign=top><strong><a id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberProfileLink href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=5313110"><u><font color=#0000ff>John Graham-Cumming</font></u></a></strong><br><br>
                <center><u><font color=#0000ff></font></u></center><br><span class=SmallText id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberType></span></td>
                <td>John Graham-Cumming is Founder and Chief Scientist at Electric Cloud. Prior to Electric Cloud, John was a Venture Consultant with Accel Partners, VP of Internet Technology at Interwoven, VP of Engineering at Scriptics, and Chief Architect at Optimal Networks. John holds BA and MA degrees in Mathematics and Computation and a Doctorate in Computer Security from Oxford University. John is the creator of GNU Make Standard Library and has six pending patents in the build space. <br><br>Electric Cloud, ElectricInsight, ElectricAccelerator, ElectricCommander and Electric Make are trademarks of Electric Cloud. Other company and product names may be trademarks of their respective owners.<br>
                <table>
                    <tbody>
                        <tr id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_locationRow>
                            <td class=SmallText>Location: </td>
                            <td width="100%"><span class=SmallText id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberLocation><img height=11 alt="United States" src="http://www.codeproject.com/script/Geo/Images/US.gif" width=16> United States</span></td>
                        </tr>
                    </tbody>
                </table>
                </td>
            </tr>
        </tbody>
    </table>
</form>
<img src ="http://www.cppblog.com/ztwaker/aggbug/57926.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-08-04 09:18 <a href="http://www.cppblog.com/ztwaker/archive/2008/08/04/57926.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>数独网址</title><link>http://www.cppblog.com/ztwaker/archive/2008/07/25/57161.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Fri, 25 Jul 2008 09:33:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/07/25/57161.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/57161.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/07/25/57161.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/57161.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/57161.html</trackback:ping><description><![CDATA[<div class="postmessage defaultpost">
<div id=ad_thread3_0></div>
<div id=ad_thread4_0></div>
<h2>国内外数独网站推荐</h2>
<div class=t_msgfont id=postmessage_307><font size=1><font color=blue>说明：在此仅列出个人觉得好的网站的地址及介绍，基本以能够在线做题为主，包括提供技巧讲解等<br>这里介绍的网站只是<span class=t_tag onclick=tagshow(event) href="tag.php?name=%CA%FD%B6%C0">数独</span>的，不包括其他nikoli的逻辑题，虽然下面有些网站会涉及到<br>如果有错误或缺失欢迎回帖指正</font><br><br>国内简体中文 <font color=red>&#8594;</font>欧泊颗oubk <font color=red>&#8594;</font>网址<a href="http://sudoku.oubk.com/" target=_blank><u><font color=#0000ff>http://sudoku.oubk.com</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>在线做题主要有各难度各规格传统数独，锯齿数独，GT（数比），killer数独，GT&amp;killer，对角线数独，对角线&amp;GT，对角线&amp;killer<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>有一些新手教程包括几个Wing的讲解，初学者比较适用<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>题目可以打印<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>开设有论坛提供讨论，论坛地址<a href="http://bbs.oubk.com/" target=_blank><u><font color=#0000ff>http://bbs.oubk.com</font></u></a><br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>独数之道|数独爱好者 <font color=green>&#8594;</font>网址<a href="http://www.sudokufans.org.cn/" target=_blank><u><font color=#800080>http://www.sudokufans.org.cn</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>在线做题主要有17格数独，17格一刀流数独，51空数独，三阶3D数独，四阶3D数独，锯齿数独，6&#215;6LED管数独<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 6&#215;6GT，6&#215;6骰子数独，六角数独（也就是WSC中的star），四空数独，牡丹数独，不连续数独，17格连体数独<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 八卦数独，无缘数独，killer数独<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>有在线PK系统，支持多人PK<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>有数独技巧，数独例题，原创数独，变型数独的文章，技巧篇有一定难度，适合已经掌握初级技巧的独友<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 例题主要采自平时和网友讨论的题目，有一定难度或趣味性，变型题来自国内外收集，可以看看新式花样<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>提供可打印，可导入谜题库，供网友下载，这里感谢kiwy提供数独大会馆的题库<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>有传统题导入系统，可以把你在别处看到的题导入后在线作答，系统会帮助你检查正确性<br><br>国内繁体中文 <font color=red>&#8594;</font>尤怪之家 <font color=red>&#8594;</font>网址<a href="http://oddest.nc.hcc.edu.tw/" target=_blank><u><font color=#0000ff>http://oddest.nc.hcc.edu.tw/</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>有數獨挑戰館 數獨大會館 4x4數獨 6x6數獨 對角數獨 離散數獨 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;無緣數獨 拒馬數獨 字母數獨 中央數獨 同位數獨 城堡數獨 愛心數獨 三國數獨 增區數獨 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;奇數數獨 偶數數獨 兩儂數獨 奇偶數獨 同類數獨 奇和數獨 五十數獨 五倍數獨 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>程式：数独大师<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>提供初级技巧的讲解，包括wing等的高级技巧<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>尤怪论坛出了些问题，暂时无法链接，稍后添加<br><br>国外英文网站 <font color=green>&#8594;</font>killersudokuonline <font color=green>&#8594;</font>网址<a href="http://www.killersudokuonline.com/" target=_blank><u><font color=#0000ff>http://www.killersudokuonline.com</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>每日每周有killer数独，GT数独，GT&amp;killer数独（和oubk的规则有些不同）<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>英国数独网站 <font color=red>&#8594;</font>网址<a href="http://www.sudoku.org.uk/" target=_blank><u><font color=#0000ff>http://www.sudoku.org.uk/</font></u></a> <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>每日killer数独，传统数独，锯齿数独<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>捷克数独网站 <font color=green>&#8594;</font>网址<a href="http://www.sudoku-league.com/" target=_blank><u><font color=#0000ff>http://www.sudoku-league.com/</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>提供每日一题（传统数独）<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>有PK系统，支持两人PK，可选择easy,middle,hard,brainkiller四种难度的传统数独题<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>澳洲数独网站 <font color=red>&#8594;</font>网址<a href="http://sudoku.com.au/" target=_blank><u><font color=#0000ff>http://sudoku.com.au/</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>提供每日一题（传统数独）<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>提供技巧讲解，难度较高<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>多人一题PK站 <font color=green>&#8594;</font>网址<a href="http://www.multiplaysudoku.com/" target=_blank><u><font color=#0000ff>http://www.multiplaysudoku.com</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>那里的玩家水平比较高，不过不用担心你会得零分，因为他们会很有绅士风度的留下几个数让你填<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>一个数独程式的作者的数独网 网址<a href="http://www.djape.net/" target=_blank><u><font color=#0000ff>http://www.djape.net</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>有传统数独，killer数独，锯齿数独，GT数独，武士数独（即五联体数独）<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>网站提供PDF或TXT源码可以导入他的软件中游戏<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>又一个数独程式的数独网 <font color=green>&#8594;</font>网址<a href="http://www.sudocue.net/" target=_blank><u><font color=#0000ff>http://www.sudocue.net/</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>提供锯齿数独，killer数独，传统数独为主，提供TXT源码可以导入他的游戏软件中<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>如果你对你的killer数独水平有信心，那可要尝试一下这里的killer题了<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>sudoku9981 <font color=red>&#8594;</font>网址<a href="http://www.sudoku9981.com/" target=_blank><u><font color=#0000ff>http://www.sudoku9981.com</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>你一定用过他程序sudoku9981，也就是中文那个数独博士，不过个人支持原装正版，网络上可以找到注册码<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>提供了PDF格式的数独题打印<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>有各类技巧的讲解，还是比较详细的，不论是初学还是有基础的都可以学习<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>Andrew的数独网站 <font color=green>&#8594;</font>网址<a href="http://www.scanraid.com/" target=_blank><u><font color=#0000ff>http://www.scanraid.com/</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>传统数独，对角线数独，锯齿数独的解答<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>各类数独技巧的讲解，适合新手，也适合有一定基础的独友<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>压轴推荐 数独教父的网站 <font color=red>&#8594;</font>网址<a href="http://www.sudoku.com/" target=_blank><u><font color=#0000ff>http://www.sudoku.com</font></u></a> <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=red>&#8594;</font>论坛中有丰富的解题技巧讲解，你可以遇到很多数独高手或数独程式高手<br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;如果你有一定英文水平的话，绝对能让你的数独水平上升很多&nbsp; &nbsp;&nbsp;&nbsp;<br><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>最后一个 <font color=green>&#8594;</font>网址<a href="http://www.sudokuhints.com/" target=_blank><u><font color=#0000ff>http://www.sudokuhints.com/</font></u></a><br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<font color=green>&#8594;</font>每天有五道传统数独题，形状一样，但是难度却不一样，适合不同阶段的玩家</font><br><br>[<em> 本帖最后由 叶卡林娜 于 2008-7-4 10:50 编辑 </em>]<!--++ plugin_code qcomic begin--> <!--++ plugin_code qcomic end--></div>
</div>
<div class=signatures style="HEIGHT: 39px; maxHeightIE: "><a href="http://www.sudokufans.org.cn/" target=_blank><u><font color=#800080>www.sudokufans.org.cn独数之道|数独爱好者 我们专注做更好的数独 轻松的数独</font></u></a> </div>
<img src ="http://www.cppblog.com/ztwaker/aggbug/57161.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-07-25 17:33 <a href="http://www.cppblog.com/ztwaker/archive/2008/07/25/57161.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>UML序列图</title><link>http://www.cppblog.com/ztwaker/archive/2008/07/25/57129.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Fri, 25 Jul 2008 04:24:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/07/25/57129.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/57129.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/07/25/57129.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/57129.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/57129.html</trackback:ping><description><![CDATA[<div class=postTitle><a class=postTitle2 id=AjaxHolder_ctl01_TitleUrl href="http://www.cnblogs.com/WCFGROUP/archive/2008/07/04/1235980.html"><font color=#78afd3>UML 序列图</font></a> </div>
来自: IBM Rational Edge<!-- #EndEditable -->
<table height=65 cellSpacing=0 cellPadding=0 width=760 align=center border=0>
    <tbody>
        <tr>
            <td class=content height=65><!-- #BeginEditable "3" -->
            <table class=content width="85%" align=center border=0>
                <tbody>
                    <tr>
                        <td class=content vAlign=top>　
                        <table width="100%">
                            <tbody>
                                <tr>
                                    <td width="30%"></td>
                                </tr>
                            </tbody>
                        </table>
                        <p><img height=261 alt=Illustration hspace=5 src="http://www.uml.org.cn/oobject/images/ill_3101.gif" width=261 border=0 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p>现在是二月，而且到如今你或许已经读到、或听到人们谈论UML 2.0 —— 包括若干进步的 UML 的新规范，所做的变化。考虑到新规范的重要性，我们也正在修改这个文章系列的基础，把我们的注意力从 OMG 的 UML 1.4 规范，转移到 OMG 的已采纳 UML 2.0草案规范（又名 UML 2）。我不喜欢在一系列文章的中间，把重点从 1.4 变为 2.0 ，但是 UML 2.0 草案规范是前进的重要一步，我感觉需要扩充文字。</em></p>
                        <p>由于一些理由，OMG 改良了 UML 。主要的理由是，他们希望 UML 模型能够表达模型驱动架构（MDA），这意味着 UML 必须支持更多的模型驱动的符号。同时， UML 1.x 符号集合有时难以适用于较大的应用程序。此外,为了要使图变成更容易阅读，需要改良符号元件。（举例来说，UML 1.x 的模型逻辑流程太复杂，有时不可能完成。对UML 2 中的序列图的符号集合的改变，已经在序列化逻辑建模方面取得巨大的进步)。</em></p>
                        <p>注意我上面所述的文字：&#8220;已采纳UML2.0草案规范。&#8221;确实，规范仍然处于草案状态，但是关键是草案规范已经被 OMG 采用，OMG是一个直到新标准相当可靠，才会采用它们的组织。 在 UML 2 完全地被采用之前，规范将会有一些修改，但是这些改变应该是极小的。主要的改变将会是在 UML 的内部 —— 包括通常被实施 UML 工具的软件公司使用的功能。</em></p>
                        <p>本文的主要目的是继续把我们的重点放在基础UML图上；这个月，我们进一步了解序列图。再次请注意，下面提供的例子正是以新的 UML 2 规范为基础。</em></p>
                        <p><a name=IDARCMUB><span class=atitle2>图的目的</span></a><br>序列图主要用于按照交互发生的一系列顺序，显示对象之间的这些交互。很象类图，开发者一般认为序列图只对他们有意义。然而，一个组织的业务人员会发现，序列图显示不同的业务对象如何交互，对于交流当前业务如何进行很有用。除记录组织的当前事件外，一个业务级的序列图能被当作一个需求文件使用，为实现一个未来系统传递需求。在项目的需求阶段，分析师能通过提供一个更加正式层次的表达，把用例带入下一层次。那种情况下，用例常常被细化为一个或者更多的序列图。</p>
                        <p>组织的技术人员能发现，序列图在记录一个未来系统的行为应该如何表现中，非常有用。在设计阶段，架构师和开发者能使用图，挖掘出系统对象间的交互，这样充实整个系统设计。</p>
                        <p>序列图的主要用途之一，是把用例表达的需求，转化为进一步、更加正式层次的精细表达。用例常常被细化为一个或者更多的序列图。序列图除了在设计新系统方面的用途外，它们还能用来记录一个存在系统（称它为&#8220;遗产&#8221;）的对象现在如何交互。当把这个系统移交给另一个人或组织时，这个文档很有用。</p>
                        <p><a name=IDA1CMUB><span class=atitle2>符号</span></a><br>既然这是我基于 UML 2的 UML 图系列文章的第一篇，我们需要首先讨论对 UML 2 图符号的一个补充，即一个叫做框架的符号元件。在 UML 2中，框架元件用于作为许多其他的图元件的一个基础，但是大多数人第一次接触框架元件的情况，是作为图的图形化边界。当为图提供图形化边界时，一个框架元件为图的标签提供一致的位置。在 UML 图中框架元件是可选择的；就如你能在图 1 和 2 中见到的，图的标签被放在左上角，在我将调用框架的&#8220;namebox&#8221;中，一种卷角长方形，而且实际的 UML 图在较大的封闭长方形内部定义。</p>
                        <img height=222 alt="图 1: 空的 UML 2 框架元件" src="http://www.uml.org.cn/oobject/images/3101_figure1.jpg" width=385 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <p><a name=IDAIDMUB><span class=atitle3>图 1: 空的 UML 2 框架元件</span></a><br></p>
                        <p>除了提供一个图形化边框之外，用于图中的框架元件也有描述交互的重要的功能, 例如序列图。在序列图上一个序列接收和发送消息（又称交互），能通过连接消息和框架元件边界，建立模型（如图 2 所见到）。这将会在后面&#8220;超越基础&#8221;的段落中被更详细地介绍。</p>
                        <p><img height=383 alt="图 2: 一个接收和发送消息的序列图" src="http://www.uml.org.cn/oobject/images/3101_figure2.jpg" width=650 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAVDMUB><span class=atitle3>图 2: 一个接收和发送消息的序列图</span></a><br></p>
                        <p>注意在图 2 中，对于序列图，图的标签由文字&#8220;sd&#8221;开始。当使用一个框架元件封闭一个图时，图的标签需要按照以下的格式:</p>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <table cellSpacing=0 cellPadding=5 width="100%" bgColor=#cccccc border=1>
                            <tbody>
                                <tr>
                                    <td>
                                    <pre><code>图类型 图名称</code></pre>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </blockquote>
                        <p>UML 规范给图类型提供特定的文本值。（举例来说，sd代表序列图，activity代表活动图，use case代表用例图）。</p>
                        <p><a name=IDADEMUB><span class=atitle2>基础</span></a><br>序列图的主要目的是定义事件序列，产生一些希望的输出。重点不是消息本身，而是消息产生的顺序；不过，大多数序列图会表示一个系统的对象之间传递的什么消息，以及它们发生的顺序。图按照水平和垂直的维度传递信息：垂直维度从上而下表示消息/调用发生的时间序列，而且水平维度从左到右表示消息发送到的对象实例。</p>
                        <p><a name=IDALEMUB><span class=atitle3>生命线</span></a><br>当画一个序列图的时候，放置生命线符号元件，横跨图的顶部。生命线表示序列中，建模的角色或对象实例。<a href="http://www.uml.org.cn/oobject/200503082.htm#notes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></a><sup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 1 </sup>生命线画作一个方格，一条虚线从上而下，通过底部边界的中心（图 3）。生命线名字放置在方格里。</p>
                        <p><img height=209 alt="图 3: 用于一个实体名为freshman的生命线的Student类的一个例子" src="http://www.uml.org.cn/oobject/images/3101_figure3.jpg" width=141 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDA4EMUB><span class=atitle3>图 3: 用于一个实体名为freshman的生命线的Student类的一个例子</span></a><br></p>
                        <p>UML 的生命线命名标准按照如下格式:</p>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <table cellSpacing=0 cellPadding=5 width="100%" bgColor=#cccccc border=1>
                            <tbody>
                                <tr>
                                    <td>
                                    <pre><code>实体名 : 类名</code></pre>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </blockquote>
                        <p>在如图3所示的例子中，生命线表示类Student的实体，它的实体名称是freshman。这里注意一点，生命线名称带下划线。当使用下划线时，意味着序列图中的生命线代表一个类的特定实体，不是特定种类的实体（例如，角色）。在将来的一篇文章中，我们将会了解结构化建模。现在，仅仅评述序列图，可能包含角色（例如<em xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">买方</em>和<em xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">卖方</em>），而不需要叙述谁扮演那些角色（例如<strong xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Bill</strong>和<strong xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Fred</strong>）。这准许不同语境的图重复使用。简单拖放，序列图的实例名称有下划线，而角色名称没有。</p>
                        <p>图 3 中我们生命线例子是一个命名的对象，但是不是所有的生命线都代表命名的对象。相反的，一个生命线能用来表现一个匿名的或未命名的实体。当在一个序列图上，为一个未命名的实例建模时，生命线的名字采用和一个命名实例相同的模式；但是生命线名字的位置留下空白，而不是提供一个例图名字。再次参考图 3，如果生命线正在表现Student类的一个匿名例图，生命线会是: &#8220;Student&#8221;。同时, 因为序列图在项目设计阶段中使用，有一个未指定的对象是完全合法: 举例来说，&#8220;freshman&#8221;。</p>
                        <p><a name=IDAWFMUB><span class=atitle3>消息</span></a><br>为了可读性，序列图的第一个消息总是从顶端开始，并且一般位于图的左边。然后继发的消息加入图中，稍微比前面的消息低些。</p>
                        <p>为了显示一个对象（例如，生命线）传递一个消息给另外一个对象，你画一条线指向接收对象，包括一个实心箭头（如果是一个同步调用操作）或一个棍形箭头（如果是一个异步讯号）。消息/方法名字放置在带箭头的线上面。正在被传递给接收对象的消息，表示接收对象的类实现的一个操作/方法。在图 4 的例子中，analyst对象调用ReportingSystem 类的一个实例的系统对象。analyst对象在调用系统对象的 getAvailableReports 方法。系统对象然后调用secSystem 对象上的、包括参数userId的getSecurityClearance 方法，secSystem的类的类型是 SecuritySystem。<a href="http://www.uml.org.cn/oobject/200503082.htm#notes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></a><sup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 2</sup></p>
                        <p><img height=210 alt="图 4: 一个在对象之间传递消息的实例" src="http://www.uml.org.cn/oobject/images/3101_figure4.jpg" width=650 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAHGMUB><span class=atitle3>图 4: 一个在对象之间传递消息的实例</span></a><br></p>
                        <p>除了仅仅显示序列图上的消息调用外，图 4 中的图还包括返回消息。这些返回消息是可选择的；一个返回消息画作一个带开放箭头的虚线，向后指向来源的生命线，在这条虚线上面，你放置操作的返回值。在图 4 中，当 getSecurityClearance 方法被调用时，secSystem 对象返回 userClearance 给系统对象。当 getAvailableReports 方法被调用时，系统对象返回 availableReports。</p>
                        <p>此外，返回消息是序列图的一个可选择部分。返回消息的使用依赖建模的具体/抽象程度。如果需要较好的具体化，返回消息是有用的；否则，主动消息就足够了。我个人喜欢，无论什么时候返回一个值，都包括一个返回消息，因为我发现额外的细节使一个序列图变得更容易阅读。</p>
                        <p>当序列图建模时，有时候，一个对象将会需要传递一个消息给它本身。一个对象何时称它本身？一个纯化论者会争辩一个对象应该永不传递一个消息给它本身。然而，为传递一个消息给它本身的对象建模，在一些情境中可能是有用的。举例来说，图 5 是图 4 的一个改良版本。 图 5 版本显示调用它的 determineAvailableReports 方法的系统对象。通过表示系统传递消息&#8220;determineAvailableReports&#8221;给它本身，模型把注意力集中到过程的事实上，而不是系统对象。</p>
                        <p>为了要画一个调用本身的对象，如你平时所作的，画一条消息，但是不是连接它到另外的一个对象，而是你把消息连接回对象本身。</p>
                        <p><img height=301 alt="图 5: 系统对象调用它的 determineAvailableReports 方法" src="http://www.uml.org.cn/oobject/images/3101_figure5.jpg" width=650 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAXGMUB><span class=atitle3>图 5: 系统对象调用它的 determineAvailableReports 方法</span></a><br></p>
                        <p>图 5 中的消息实例显示同步消息；然而，在序列图中，你也能为异步消息建模。一个异步消息和一个同步的画法类似，但是消息画的线带一个棍形矛头，如图 6 所示。</p>
                        <p><img height=208 alt="图 6: 表示传递到实体2的异步消息的序列图片段" src="http://www.uml.org.cn/oobject/images/3101_figure6.jpg" width=364 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAGHMUB><span class=atitle3>图 6: 表示传递到实体2的异步消息的序列图片段</span></a><br></p>
                        <p><a name=IDAOHMUB><span class=atitle3>约束</span></a><br>当为对象的交互建模时，有时候，必须满足一个条件，消息才会传递给对象。约束在 UML 图各处中，用于控制流。在这里，我将会讨论UML 1.x 及UML 2.0两者的约束。在 UML 1.x 中，一个约束只可能被分配到一个单一消息。UML 1.x中，为了在一个序列图上画一个约束，你把约束元件放在约束的消息线上，消息名字之前。图 7 显示序列图的一个片段，消息addStudent 方法上有一个约束。</p>
                        <p><img height=252 alt="图 7:UML 1.x 序列图的一个片段，其中addStudent 消息有一个约束" src="http://www.uml.org.cn/oobject/images/3101_figure7.jpg" width=614 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDA2HMUB><span class=atitle3>图 7:UML 1.x 序列图的一个片段，其中addStudent 消息有一个约束</span></a><br></p>
                        <p>在图 7 中，约束是文本&#8220;[ pastDueBalance=0]&#8221;。通过这个消息上的约束，如果应收帐系统返回一个零点的逾期平衡，addStudent 消息才将会被传递。约束的符号很简单；格式是:</p>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <table cellSpacing=0 cellPadding=5 width="100%" bgColor=#cccccc border=1>
                            <tbody>
                                <tr>
                                    <td>
                                    <pre><code>[Boolean Test]</code></pre>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </blockquote>
                        <p>举例来说，</p>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <table cellSpacing=0 cellPadding=5 width="100%" bgColor=#cccccc border=1>
                            <tbody>
                                <tr>
                                    <td>
                                    <pre><code>[pastDueBalance = 0]</code></pre>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </blockquote>
                        <p><a name=IDARYRUB><span class=atitle3>组合碎片(变体方案，选择项，和循环)</span></a><br>然而，在大多数的序列图中，UML 1.x&#8220;in-line&#8221;约束不足以处理一个建模序列的必需逻辑。这个功能缺失是 UML 1.x 的一个问题。UML 2 已经通过去掉&#8220;in-line&#8221;约束，增加一个叫做组合碎片的符号元件，解决了这一个问题。一个组合碎片用来把一套消息组合在一起，在一个序列图中显示条件分支。UML 2 规范指明了组合碎片的 11 种交互类型。十一种中的三种将会在&#8220;基础&#8221;段落中介绍，另外两种类型将会在&#8220;超越基础&#8221;中介绍，而那剩余的六种我将会留在另一篇文章中介绍。（嗨，这是一篇文章而不是一本书。我希望你在一天中看完这部分！）</p>
                        <p><a name=IDAZYRUB><span class=atitle3>变体</span></a><br>变体用来指明在两个或更多的消息序列之间的、互斥的选择。<a href="http://www.uml.org.cn/oobject/200503082.htm#notes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></a><sup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 3 </sup>变体支持经典的&#8220;if then else&#8221;逻辑的建模（举例来说，<strong xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">如果</strong> 我买三个，<strong xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">然后</strong> 我得到 我购买的20% 折扣；<strong xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">否则</strong> 我得到我购买的 10% 折扣）。</p>
                        <p>就如你将会在图 8 中注意到的，一个变体的组合碎片元件使用框架来画。单词&#8220;alt&#8221;放置在框架的namebox里。然后较大的长方形分为 UML 2 所称的操作元。<a href="http://www.uml.org.cn/oobject/200503082.htm#notes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></a><sup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4 </sup>操作元被虚线分开。每个操作元有一个约束进行测试，而这个约束被放置在生命线顶端的操作元的左上部。<a href="http://www.uml.org.cn/oobject/200503082.htm#notes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></a><sup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 5 </sup>如果操作元的约束等于&#8220;true&#8221;，然后那个操作元是要执行的操作元。</p>
                        <p><img height=766 alt="图 8：包含变体组合碎片的一个序列图片段" src="http://www.uml.org.cn/oobject/images/3101_figure8.jpg" width=507 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDA2ZRUB><span class=atitle3>图 8：包含变体组合碎片的一个序列图片段</span></a><br></p>
                        <p>图 8作为一个变体的组合碎片如何阅读的例子，显示序列从顶部开始，即bank对象获取支票金额和帐户结余。此时，序列图中的变体组合碎片接管。因为约束&#8220;[balance &gt;= amount]&#8221;，如果余额超过或等于金额，然后顺序进行bank对象传递 addDebitTransaction 和 storePhotoOfCheck 消息给account对象。然而，如果余额不是超过或等于金额，然后顺序的过程就是bank传递addInsuffientFundFee 和 noteReturnedCheck 消息给account对象，returnCheck 消息给它自身。因为&#8220;else&#8221;约束，当余额不大于或者等于金额时，第二个序列被调用。在变体的组合碎片中，不需要&#8220;else&#8221;约束；而如果一个操作元，在它上面没有一个明确的约束，那么将假定&#8220;else&#8221;约束。</p>
                        变体的组合碎片没被限制在简单的&#8220;if then else&#8221;验证。可能需要大量的变体路径。 如果需要较多的变体方案，你一定要做的全部工作就是把一个操作元加入有序列约束和消息的长方形中。
                        <p><a name=IDAG0RUB><span class=atitle3>选择项</span></a><br>选择项组合碎片用来为序列建模，这些序列给予一个特定条件，将会发生的；或者，序列不发生。一个选择项用来为简单的&#8220;if then&#8221;表达式建模。（例如，如果架上的圈饼少于五个，那么另外做两打圈饼）。</p>
                        <p>选择项组合碎片符号与变体组合碎片类似，除了它只有一个操作元并且永不能有&#8220;else&#8221;约束以外（它就是如此，没有理由）。要画选择项组合，你画一个框架。文字&#8220;opt&#8221;是被放置在框架的 namebox 里的文本，在框架的内容区，选择项的约束被放置在生命线顶端上的左上角。 然后选择项的消息序列被放在框架的内容区的其余位置内。这些元件如图 9 所示。</p>
                        <p><img height=527 alt="图 9：包括选择项组合碎片的一个序列图片段" src="http://www.uml.org.cn/oobject/images/3101_figure9.jpg" width=626 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAV0RUB><span class=atitle3>图 9：包括选择项组合碎片的一个序列图片段</span></a><br></p>
                        <p>阅读选择项组合碎片很容易。图 9 是图 7 的序列图片段的再加工，但是这次它使用一个选择项组合碎片，因为如果Student的逾期平衡等于0，需要传递更多的消息。按照图 9 的序列图，如果Student的逾期平衡等于零，然后传递addStudent，getCostOfClass和chargeForClass消息。如果Student的逾期平衡不等于零，那么在选择项组合碎片中，序列不传递任何一个消息。</p>
                        <p>例子图 9的序列图片段包括一个选择项约束；然而，约束不是一个必需的元件。在高层次、抽象的序列图中，你可能不想叙述选择项的条件。你可能只是想要指出片段是可选择的。</p>
                        <p><a name=IDA50RUB><span class=atitle3>循环</span></a><br>有时候你将会需要为一个重复的序列建模。在 UML 2 中，为一个重复的序列建模已经改良，附加了循环组合碎片。</p>
                        <p>循环组合碎片表面非常类似选择项组合碎片。你画一个框架，在框架的 namebox 中放置文本&#8220;loop&#8221;。在框架的内容区中，一个生命线的顶部，循环约束<a href="http://www.uml.org.cn/oobject/200503082.htm#notes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></a><sup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 6 </sup>被放置在左上角。然后循环的消息序列被放在框架内容区的其余部分中。在一个循环中，除了标准的布尔测试外，一个约束能测试二个特定的条件式。特定的约束条件式是写作&#8220;minint = [the number]&#8221;（例如，&#8220;minint = 1&#8221;）的最小循环次数，和写作&#8220;maxint = [the number]&#8221;（例如，&#8220;maxint = 5&#8221;）的最大循环次数。通过最小循环检验，循环必须运行至少指定次数，而循环执行次数不能达到约束指定的最大循环次数。</p>
                        <p><img height=452 alt="图 10：循环组合碎片的一个序列图例子" src="http://www.uml.org.cn/oobject/images/3101_figure10_small.jpg" width=650 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAR1RUB><span class=atitle3>图 10：循环组合碎片的一个序列图例子 （单击放大）</span></a><br></p>
                        <p>在图 10 中显示的循环运行，直到 reportsEnu 对象的 hasAnotherReport 消息返回false。如果循环序列应该运行，这个序列图的循环使用一个布尔测试确认。为了阅读这个图，你和平常一样，从顶部开始。当你到达循环组合碎片，做一个测试，看看值 hasAnotherReport 是否等于true。如果 hasAnotherReport 值等于true，于是序列进入循环片断。然后你能和正常情况一样，在序列图中跟踪循环的消息。</p>
                        <p><a name=IDAA2RUB><span class=atitle2>超越基础</span></a><br></p>
                        我已经介绍了序列图的基础，应该使你可以为将会在系统中通常发生的大部份交互建模。下面段落将会介绍用于序列图的比较高阶的符号元件。
                        <p><a name=IDAI2RUB><span class=atitle3>引用另外一个序列图</span></a><br>当做序列图的时候，开发者爱在他们的序列图中，重用存在的序列图。<a href="http://www.uml.org.cn/oobject/200503082.htm#notes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></a><sup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 7 </sup>在 UML 2 中开始，引进&#8220;交互进行&#8221;元件。追加交互进行的可以说是 UML 2 交互建模中的最重要的创新。交互进行增加了功能，把原始的序列图组织成为复杂的序列图。由于这些，你能组合（重用）较简单的序列，生成比较复杂的序列。这意味你能把完整的、可能比较复杂的序列，抽象为一个单一的概念单位。</p>
                        <p>一个交互进行元件使用一个框架绘制。文字&#8220;ref&#8221;放置在框架的 namebox 中，引用的序列图名字放置在框架的内容区里，连同序列图的任何参数一起。引用序列图的名字符号如下模式:</p>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <table cellSpacing=0 cellPadding=5 width="100%" bgColor=#cccccc border=1>
                            <tbody>
                                <tr>
                                    <td>
                                    <pre><code>序列图名[(参数)] [: 返回值]</code></pre>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </blockquote>
                        <p>两个例子:</p>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1. <code>Retrieve Borrower Credit Report(ssn) : borrowerCreditReport</code> </blockquote>
                        <p>或者</p>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2. <code>Process Credit Card(name, number, expirationDate, amount : 100)</code> </blockquote>
                        <p>在例子 1 中，语法调用叫做Retrieve Borrower Credit Report的序列图，传递给它参数 ssn。序列Retreive Borrower Credit Report返回变量 borrowerCreditReport 。</p>
                        <p>在实例 2 中，语法调用叫做Process Credit Card的序列图，传递给它参数name，number，expiration date，和 amount。然而，在例子 2 中，amount参数将会是值100。因为例子2没有返回值标签，序列不返回值（假设，建模的序列不需要返回值）。</p>
                        <p><img height=458 alt="图 11: 一个引用两个不同序列图的序列图" src="http://www.uml.org.cn/oobject/images/3101_figure11.jpg" width=650 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAM3RUB><span class=atitle3>图 11: 一个引用两个不同序列图的序列图</span></a><br></p>
                        <p>图 11 显示一个序列图，它引用了序列图&#8220;Balance Lookup&#8221;和&#8220;Debit Account&#8221;。序列从左上角开始，客户传递一个消息给teller对象。teller对象传递一个消息给 theirBank 对象。那时，调用Balance Lookup序列图，而 accountNumber作为一个参数传递。Balance Lookup序列图返回balance变量。然后检验选择项组合碎片的约束条件，确认余额大于金额变量。在余额比金额更大的情况下，调用Debit Account序列图，给它传递参数accountNumber 和amount。在那个序列完成后，withdrawCash 消息为客户返回cash。</p>
                        <p>重要的是，注意在图 11 中，theirBank 的生命线被交互进行Balance Lookup隐藏了。因为交互进行隐藏生命线，意味着theirBank 生命线在&#8220;Balance Lookup&#8221;序列图中被引用。除了隐藏交互进行的生命线之外，UML 2 也指明，生命线在它自己的&#8220;Balance Lookup&#8221;序列中，一定有相同的 theirBank 。</p>
                        <p>有时候，你为一个序列图建模，其中交互进行会重叠<em xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">没有</em> 在交互进行中引用的生命线。在那种情况下，生命线和正常的生命线一样显示，不会被重叠的交互进行隐藏。</p>
                        <p>在图 11 中，序列引用&#8220;Balance Lookup&#8221;序列图。&#8220;Balance Lookup&#8221;序列图在图 12 中显示。因为例子序列有参数和一个返回值，它的标签 —— 位于图的 namebox 中 —— 按照一个特定模式:</p>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <table cellSpacing=0 cellPadding=5 width="100%" bgColor=#cccccc border=1>
                            <tbody>
                                <tr>
                                    <td>
                                    <pre><code>图类型 图名 [参数类型:参数名]</code></pre>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </blockquote>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <table cellSpacing=0 cellPadding=5 width="100%" bgColor=#cccccc border=1>
                            <tbody>
                                <tr>
                                    <td>
                                    <pre><code>[: 返回值类型]</code></pre>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </blockquote>
                        <p>两个例子:</p>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1. <code>SD Balance Lookup(Integer : accountNumber) : Real</code> </blockquote>
                        <p>或</p>
                        <blockquote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2. <code>SD Available Reports(Financial Analyst : analyst) : Reports</code> </blockquote>
                        <p>图 12 举例说明例子 1，在里面，Balance Lookup序列把参数 accountNumber 作为序列中的变量使用，序列图显示返回的Real对象。在类似这种情况下，返回的对象采用序列图实体名。</p>
                        <p><img height=325 alt="图 12: 一个使用 accountNumber 参数并返回一个Real对象的序列图" src="http://www.uml.org.cn/oobject/images/3101_figure12.jpg" width=650 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAU4RUB><span class=atitle3>图 12: 一个使用 accountNumber 参数并返回一个Real对象的序列图</span></a><br></p>
                        <p>图 13 举例说明例子 2，在里面，一个序列图获取一个参数，返回一个对象。然而，在图 13 中参数在序列的交互中使用。</p>
                        <p><img height=543 alt="图 13: 一个在它的交互中使用参数、返回一个Reports对象的序列图" src="http://www.uml.org.cn/oobject/images/3101_figure13.jpg" width=650 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAB5RUB><span class=atitle3>图 13: 一个在它的交互中使用参数、返回一个Reports对象的序列图</span></a><br></p>
                        <p><a name=IDAJ5RUB><span class=atitle3>门</span></a><br>前面的段落展示如何通过参数和返回值传递信息，引用另一个序列图。然而，有另一个方法在序列图之间传递消息。门可能是一个容易的方法，为在序列图和它的上下文之间的传递消息建模。一个门只是一个消息，图形表示为一端连接序列图的框架边缘，另一端连接到生命线。使用门的图 11 和 12 ，在图 14 和 15 中可以被看到重构。图 15 的例图有一个叫做getBalance的入口门，获取参数 accountNumber。因为是箭头的线连接到图的框架，而箭头连接到生命线，所以 getBalance 消息是一个入口门。序列图也有一个出囗门，返回balance变量。出口门同理可知，因为它是一个返回消息，连接从一个生命线到图的框架，箭头连接框架。</p>
                        <p><img height=296 alt="图 14: 图 11 的重构，这次使用门" src="http://www.uml.org.cn/oobject/images/3101_figure14.jpg" width=650 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAV5RUB><span class=atitle3>图 14: 图 11 的重构，这次使用门</span></a><br></p>
                        <p><img height=391 alt="图 15: 图 12 的重构，这次使用门" src="http://www.uml.org.cn/oobject/images/3101_figure15.jpg" width=650 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAEASUB><span class=atitle3>图 15: 图 12 的重构，这次使用门</span></a><br></p>
                        <p><a name=IDAMASUB><span class=atitle3>组合碎片（跳转和并行）</span></a><br>在本文前面&#8220;基础&#8221;的段落中呈现的，我介绍了&#8220;变体&#8221;，&#8220;选择项&#8221;，和&#8220;循环&#8221;的组合碎片。这些三个组合碎片是大多数人将会使用最多的。然而，有二个其他的组合碎片，大量共享的人将会发现有用——跳转和并行。</p>
                        <p><a name=IDAUASUB><span class=atitle3>跳转</span></a><br>跳转组合碎片几乎在每个方面都和选择项组合碎片一致，除了两个例外。首先，跳转的框架namebox的文本&#8220;break&#8221;代替了&#8220;option&#8221;。其次, 当一个跳转组合碎片的消息运行时，封闭的交互作用的其他消息将不会执行，因为序列打破了封闭的交互。这样，跳转组合碎片非常象 C++ 或 Java 的编程语言中的break关键字。</p>
                        <p><img height=750 alt="图 16: 来自图 8 的序列图片段的重构，片段使用跳转代替变体" src="http://www.uml.org.cn/oobject/images/3101_figure16.jpg" width=650 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAABSUB><span class=atitle3>图 16: 来自图 8 的序列图片段的重构，片段使用跳转代替变体</span></a><br></p>
                        <p>跳转最常用来做模型异常处理。图 16 是图 8 的重构，但是这次图16使用跳转组合碎片，因为它把balance &lt; amount的情况作为一个异常对待，而不是一个变体流。要阅读图 16，你从序列的左上角开始，向下读。当序列到达返回值&#8220;balance&#8221;的时候，它检查看看是否余额比金额更少。如果余额不少于金额，被传递的下一个消息是 addDebitTransaction 消息，而且序列正常继续。然而，在余额比金额更少的情况下，然后序列进入跳转组合碎片，它的消息被传递。一旦跳转组合的消息的已经被传递，序列不发送任何其它消息就退出（举例来说，addDebitTransaction）。</p>
                        <p>注意有关跳转的一件重要的事是，它们只引起一个封闭交互的序列退出，不必完成图中描述的序列。在这种情况下，跳转组合是变体或者循环的一部分，然后只是变体或循环被退出。</p>
                        <p><a name=IDAKBSUB><span class=atitle3>并行</span></a><br>今天的现代计算机系统在复杂性和有时执行并发任务方面不断进步。当完成一个复杂任务需要的处理时间比希望的长的时候，一些系统采用并行处理进程的各部分。当创造一个序列图，显示并行处理活动的时候，需要使用并行组合碎片元件。</p>
                        <p>并行组合碎片使用一个框架来画，你把文本&#8220;par&#8221;放在框架的 namebox 中。然后你把框架的内容段用虚线分为水平操作元。框架的每个操作元表示一个在并行运行的线程。</p>
                        <p><img height=446 alt="图 17: oven 是并行做两个任务的对象实例" src="http://www.uml.org.cn/oobject/images/3101_figure17.jpg" width=613 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></p>
                        <p><a name=IDAXBSUB><span class=atitle3>图 17: oven 是并行做两个任务的对象实例</span></a><br></p>
                        <p>图 17 可能没有举例说明做并行活动的对象的最好的计算机系统实例，不过提供了一个容易理解的并行活动序列的例子。序列如这样进行：hungryPerson 传递 cookFood 消息给oven 对象。当oven 对象接收那个消息时，它同时发送两个消息（nukeFood 和 rotateFood）给它本身。这些消息都处理后，hungryPerson 对象从oven 对象返回 yummyFood 。</p>
                        <p><a name=IDAACSUB><span class=atitle2>总结</span></a><br>序列图是一个用来记录系统需求，和整理系统设计的好图。序列图是如此好用的理由是，因为它按照交互发生的时间顺序，显示了系统中对象间的交互逻辑。</p>
                        <p><a name=IDAICSUB><span class=atitle2>参考</span></a><br></p>
                        <ul xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                            <li>UML 2.0 Superstructure Final Adopted Specification (第8章部分) http://www.omg.org/cgi-bin/doc?ptc/2003-08-02
                            <li>UML 2 Sequence Diagram Overview http://www.agilemodeling.com/artifacts/sequenceDiagram.htm
                            <li>UML 2 Tutorial http://www.omg.org/news/meetings/workshops/UML%202003%20Manual/Tutorial7-Hogg.pdf </li>
                        </ul>
                        <a name=notes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></a>
                        <p><a name=IDAEDSUB><span class=atitle2>脚注</span></a><br>1 在完全建模系统中，对象（类的实例）也将会在系统的类图中建模。</p>
                        <p>2 当阅读这个序列图时，假定分析师登录进入系统之内。</p>
                        <p>3 请注意，附着在不同的变体操作元上的、两个或更多的约束条件式的确可能同时是真，但是实际最多只有一个操作元将会在运行时发生（那种情况下变体的&#8220;wins&#8221;没有按照 UML 标准定义)。</p>
                        <p>4 虽然操作元看起来非常象公路上的小路，但是我特别不叫它们小路。泳道是在活动图上使用的 UML 符号。请参考<em xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">The Rational Edge</em> 早期关于 活动图的文章。</p>
                        <p>5 通常，附上约束的生命线是拥有包含在约束表达式中的变量的生命线。</p>
                        <p>6 关于选择项组合碎片，循环组合碎片不需要在它上放置一个约束条件。</p>
                        <p>7 可能重用任何类型的序列图（举例来说，程序或业务）。我只是发现开发者更喜欢按功能分解他们的图。</p>
                        <p><a name=resources><span class=atitle2>参考资料</span></a>
                        <ul>
                            <li>您可以参阅本文在 developerWorks 全球站点上的 <a href="http://www.ibm.com/developerworks/rational/library/3101.html" target=_blank xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><u><font color=#78afd3>英文原文</font></u></a>。<br></li>
                        </ul>
                        <p>　</p>
                        <table cellSpacing=0 cellPadding=0 width="100%" border=0>
                            <tbody>
                                <tr>
                                    <td><a name=author1></a><span class=content>关于作者<br><img height=80 alt="Donald Bell" src="http://www.uml.org.cn/oobject/images/donaldBell.jpg" width=64 align=left border=0 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Donald Bell是IBM全球服务的一个IT专家，在那儿他和IBM的客户一起致力于设计和开发基于软件解决方案的J2EE。</span></td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
<img src ="http://www.cppblog.com/ztwaker/aggbug/57129.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-07-25 12:24 <a href="http://www.cppblog.com/ztwaker/archive/2008/07/25/57129.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>好书列表[ZT]</title><link>http://www.cppblog.com/ztwaker/archive/2008/07/21/56761.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Mon, 21 Jul 2008 06:56:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/07/21/56761.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/56761.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/07/21/56761.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/56761.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/56761.html</trackback:ping><description><![CDATA[<p>以下内容来自：<a href="http://www.umlchina.com/book/book.htm">http://www.umlchina.com/book/book.htm</a><br><br>*以下是现在这个时候首选阅读的国内出版书籍，这些书已经过UMLChina专家购买阅读之后才会郑重推荐，选择仅代表UMLChina观点。<br>*本列表会不定时更新，每次更新都会向列表里增加一些新书，也删去一些老书，被删去的原因可能是随时间的淘汰，也可能是我们对这些书有了新的认识。</p>
<p><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.china-pub.com/36363" target=_blank>《修改代码的艺术》</a></strong>，Michael Feathers 著， 刘未鹏 译，人民邮电出版社，2007。</font><br><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.china-pub.com/38162" target=_blank>《UML嵌入式设计》</a></strong>，高焕堂 著， UMLChina改编，清华大学出版社，2008。</font><br><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.china-pub.com/computers/common/info.asp?id=36020" target=_blank>《Head First 设计模式》</a></strong>，Eric Freeman, Elisabeth Freeman, Kathy Ierra, Bert Bates 著， O'Reilly台湾 译，UMLChina改编，中国电力出版社，2007。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.china-pub.com/computers/common/info.asp?id=34727" target=_blank>《掌握需求过程(第2版)》</a></strong>，Suzanne Robertson/James Robertson 著， 王海鹏 译，人民邮电出版社，2007。</font><br><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.huachu.com.cn/itbook/itbookinfo.asp?lbbh=10030684" target=_blank>《软件工程实践者的研究方法原书第6版》</a></strong>，Roger S. Pressman 著，郑人杰/马素霞/白晓颖 译，机械工业出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.google.com/search?q=%E9%87%8D%E6%9E%84%E4%B8%8E%E6%A8%A1%E5%BC%8F&amp;hl=zh-CN&amp;lr=&amp;nxpt=10.864203136633793326615" target=_blank>《重构与模式》</a></strong>，JOSHUA KEREVSKY 著，杨光/刘基诚 译，人民邮电出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.china-pub.com/computers/common/info.asp?id=32470" target=_blank>《设计模式初学者指南》</a></strong>，Allen Holub 著，徐迎晓 译，机械工业出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.china-pub.com/computers/common/info.asp?id=32587" target=_blank>《程序开发原理--抽象、规格与面向对象设计》</a></strong>，Barbara Liskov, John Guttag 著，裘健 译，电子工业出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.dearbook.com.cn/book/110553" target=_blank>《设计模式解析（第2版）》</a></strong>，Alan Shalloway, James R.Trott 著，徐言声 译，人民邮电出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.china-pub.com/computers/common/info.asp?id=31703" target=_blank>《Visual Basic设计模式》</a></strong>，Mark Grand, Brad Merrill 著，杨环英、周锐博 译，人民邮电出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.china-pub.com/computers/common/info.asp?id=30704" target=_blank>《UML用户指南（第2版）》</a></strong>，Grady Booch,James Rumbaugh,Ivar Jacobson 著，邵维忠 麻志毅 马浩海 刘辉 译，人民邮电出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.china-pub.com/computers/common/info.asp?id=29703" target=_blank>《UML2.0和统一过程（原书第2版） 》</a></strong>，Jim Arlow,Ila Neustadt 著，方贵宾 胡辉良 译，机械工业出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.google.com/search?hl=zh-CN&amp;q=MDA%E4%B8%8E%E5%8F%AF%E6%89%A7%E8%A1%8CUML&amp;btnG=Google%2B%E6%90%9C%E7%B4%A2&amp;lr=" target=_blank>《MDA与可执行UML》</a></strong>，Chris Raistrick,Paul Francis,John Wright 著，机械工业出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.google.com/search?hl=zh-CN&amp;newwindow=1&amp;q=%E5%AF%B9%E8%B1%A1%E8%AE%BE%E8%AE%A1%2B%E5%87%BA%E7%89%88%E7%A4%BE&amp;btnG=%E6%90%9C%E7%B4%A2&amp;lr=" target=_blank>《对象设计》</a></strong>，Rebecca Wirfs-Brock, Alan McKean 著，人民邮电出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.google.com/search?hl=zh-CN&amp;newwindow=1&amp;q=%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E5%88%86%E6%9E%90%E4%B8%8E%E8%AE%BE%E8%AE%A1%EF%BC%88UML%2B2.0%E7%89%88%EF%BC%89&amp;btnG=%E6%90%9C%E7%B4%A2&amp;lr=" target=_blank>《面向对象分析与设计（UML 2.0版）》</a></strong>，Mike O'Docherty 著，俞志翔 译，清华大学出版社，2006。</font><br><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.google.com/search?hl=zh-CN&amp;q=%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1%E7%9A%84%E6%A8%A1%E5%BC%8F%E8%AF%AD%E8%A8%80-%E5%8D%B72&amp;btnG=Google%2B%E6%90%9C%E7%B4%A2&amp;lr=" target=_blank>《程序设计的模式语言-卷2》</a></strong>，John M.Vlissides, James O.Coplien, Norman L.Kerth 著，詹文军 周毅 译，清华大学出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong><a href="http://www.google.com/search?hl=zh-CN&amp;newwindow=1&amp;q=%E9%A2%86%E5%9F%9F%E9%A9%B1%E5%8A%A8%E8%AE%BE%E8%AE%A1&amp;btnG=%E6%90%9C%E7%B4%A2&amp;lr=" target=_blank>《领域驱动设计》</a></strong>，Eric Evans 著，陈大峰、张泽鑫 译，清华大学出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《UML面向对象建模与设计（第2版）》</strong>，Michael Blaha, James Rumbaugh 著，人民邮电出版社，2006。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《统一过程最佳实践移交和产品化阶段》</strong>，Scott W.Ambler 著，机械工业出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《敏捷数据》</strong>，Scott W.Ambler 著，机械工业出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《过程模式（上册）》</strong>，Scott W.Ambler 著，人民邮电出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向模式的软件体系结构：卷3》</strong>，Michael Kircher, Prashant Jain 著，机械工业出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《Enterprise Java with UML 中文版》</strong>，C.T.Arrington、Syed H.Rayhan 著，机械工业出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《平衡敏捷与规范》</strong>，Barry Boehm、Richard Turner 著，清华大学出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《UML参考手册 （第2版）》</strong>，James Rumbaugh、Ivar Jacobson、Grady Booch 著，机械工业出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《The Object Primer中文版》</strong>，Scott W.Ambler 著，机械工业出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《C#设计模式》</strong>，Steve John Metsker 著，中国电力出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《重构极限编程—XP的实践与反思》</strong>，Matt Stephens、Doug Rosenberg 著，清华大学出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《Clouds to Code 中文版》</strong>，Jesse Liberty 著，徐峰 译，电子工业出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《对象模型：策略、模式与应用》（第2版）</strong>，Peter Coad 著，科学出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《用例驱动UML对象建模应用——范例分析》</strong>，Doug Rosenberg、Kendall Scott 著，人民邮电出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《DSDM业务中心框架开发方法（第二版）》</strong>，DSDM Consortium、Jennifer Stapleton 著，人民邮电出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《UML精粹——标准对象建模语言简明指南》（第3版）</strong>，Martin Fowler 著，徐家福 译，清华大学出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《软件开发问题框架：现实世界问题的结构化分析》</strong>，Michael Jackson 著，机械工业出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《UML对象、组件和框架——Catalysis方法》</strong>，Desmond Francis D&#8217;Souza、Alan Cameron Wills 著，清华大学出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《UML 2工具箱》</strong>，Hans-Erik Eriksson 著，电子工业出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《软件需求》（第2版）</strong>，Karl E.Wiegers 著，清华大学出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《程序设计的模式语言-卷4》</strong>，Neil Harrison、Brian Foote、Hans Rohnert 著，清华大学出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《程序设计的模式语言-卷3》</strong>，Robert Martin、Dirk Riehle、Frank Buschmann 著，清华大学出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《超越传统的软件开发——极限编程的幻象与真实》</strong>，雷剑文 陈振冲 李明树 著，电子工业出版社，2005。</font><font color=#666666><br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《Contributing to Eclipse中文版</strong>》，Erich Gamma、Kent Beck 著，中国电力出版社，2005。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《数据模型资源手册（卷2）》（修订版）</strong>，Len Silverston 著，机械工业出版社，2004。</font><font color=#666666><br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《OOD启思录》</strong>，Arthur J.Riel 著，人民邮电出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《探索需求——设计前的质量》</strong>，Donald C. Gause, Gerald M. Weinberg 著，清华大学出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《OMT应用》</strong>，Kurt W.Derr 著，清华大学出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《企业应用架构模式》</strong>，Martin Fowler 著，机械工业出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《数据建模：分析与设计的工具和技术》</strong>，Steve Hoberman 著，机械工业出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《UML基础、案例和应用》（第3版）</strong>，Joseph Schmuller 著，李虎 译，人民邮电出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《用UML设计并发、分布式、实时应用》</strong>，Hassan Gomaa 著，北京航空航天大学出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向模式分析和设计——通过模式合成来进行软件系统的设计》（影印版）</strong>，Sherif Yacoub, Hany Ammar 著，中国电力出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《UML风格》</strong>，Scott W. Ambler 著，王少峰 译，清华大学出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《软件需求管理：用例方法》（第2版）</strong>，Dean Leffingwell, Don Widrig 著，蒋慧 译，中国电力出版社，2004。</font><font color=#666666><br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《UML业务建模》</strong>，Hans-Erik Eriksson, Magnus Penker 著，夏昕、何克清 译，机械工业出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《解析MDA》</strong>，Anneke Kleppe,Jos Warmer,Wim Bast 著，鲍志云 译，人民邮电出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《产生式编程——方法、工具与应用》</strong>，Krzysztof Czarnecki,Ulrich W.Eisenecker 著，梁海华 译，中国电力出版社，2004。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《C++网络编程 卷1：运用ACE和模式消除复杂性》</strong>，Douglas C.Schmidt,Stephen D.Huston 著，於春景 译，华中科技大学出版社，2003。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《分析模式：可复用的对象模型》</strong>，Martin Fowler 著，樊东平 张路 译，机械工业出版社，2004。<br></font><font color=#666666></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《敏捷软件开发》</strong>，Alistair Cockburn 著，俞涓 译，人民邮电出版社，2003。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《实时UML——开发嵌入式系统高效对象》</strong>，Bruce Powel Douglass 著，尹浩琼 译，中国电力出版社，2003。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《用UML构建Web应用》（第2</strong></font><font color=#666666><strong>版）</strong>，Jim Conallen 著，陈起 译，中国电力出版社，2003。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《应用MDA》</strong>，David S.Frankel 著，鲍志云 译，人民邮电出版社，2003。</font><font color=#666666><br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《人本界面：交互式系统设计》</strong>，Jef Raskin 著，史元春 译，机械工业出版社，2003。<br></font><font color=#666666></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向模式的软件体系结构 卷2：用于并发和网络化对象的模式》</strong>，Douglas Schmidt 著，张志祥 译，机械工业出版社，2003。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向对象分析与设计（原书第2版）》</strong>，Grady Booch 著，冯博琴 译，机械工业出版社，2003。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《敏捷软件开发：原则、模式与实践》</strong>，Robert C. Martin 著，邓辉 译，清华大学出版社，2003。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《VS.NET UML建模高级编程——应用Visio for Enterprise Architects》</strong>，Andrew Filev 著，冯丽 译，清华大学出版社，2003。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向对象软件设计经典》</strong>，Rebecca Wirfs-Brock 著，张金明 译，电子工业出版社，2003。<br></font><font color=#666666></font><font color=#666666></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《有效用例模式》</strong>，Steve Adolph, Paul Bramble 著，车立红 译，清华大学出版社，2003。UMLChina训练教材。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《用例建模》</strong>，Kurt Bittner 著，姜昊 译，清华大学出版社，2003。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向对象方法原理与实践》（第3版）</strong>，Ian Graham 著，袁兆山 译，机械工业出版社，2003。对象技术知识大全。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《统一软件开发过程之路》</strong>，Ivar Jacobson 著，程宾 朱鹏 张嘉路 译，机械工业出版社，2003。其实是Ivar Jacobson在90年代的文集。</font><font color=#666666><br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向对象软件构造（第2版）》（影印版）</strong>，Bertrand Meyer，机械工业出版社，2003。</font><font color=#666666><br></font><font color=#666666></font><font color=#666666></font><font color=#666666></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《软件复用：结构、过程和组织》</strong>，Ivar Jacobson 著，韩柯 译，机械工业出版社，2003。</font><font color=#666666><br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向模式的软件体系结构 卷1：模式系统》</strong>，Frank Buschmann 等 著，贲可荣 译，机械工业出版社，2003。<br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《编写有效用例》</strong>，Alistair Cockburn 著，王雷、张莉 译，机械工业出版社，2002。</font><br><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向对象的软件测试》</strong>，John D.McGregor David A.sykes 著，杨文宏 译，机械工业出版社，2002。</font><font color=#666666><br><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《UML with Rational Rose 2002 从入门到精通》</strong>，电子工业出版社，2002。用来学习工具操作，书中方法不可学。 </font><font color=#666666><br></font><font color=#666666><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《统一软件开发过程》</strong>，Ivar Jacobson，James Rumbaugh，Grady Booch 著，周伯生 译，机械工业出版社，2002年1月。<br><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《UML面向对象设计基础》</strong>，Meilir Page-Jones著，包晓露等译，人民邮电出版社，2001年4月第1版。 <br><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《Oracle 8 UML对象建模设计》</strong>，机械工业出版社，2000年4月。很实用。<br><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《设计模式 可复用面向对象软件的基础》</strong>，Erich Gamma等 著，李英军 译，机械工业出版社，2000<br><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向对象的分析》</strong>，&#8220;面向对象的设计&#8221;，两本小册子，Peter Coad，Edward Yourdon著，邵维忠等译，北大出版社，原书1991年写就。国内第一本关于面向对象分析和设计的书。 <br><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《实用面向对象软件工程教程》</strong>，Edward Yourdon, Carl Argila著，电子工业出版社，原书1995年12月写就。 <br><img src="http://www.umlchina.com/images/share/book.gif"> <strong>《面向对象的系统分析》</strong>，邵维忠，杨芙清，清华大学，广西科技出版，1998年12月第一版。 <br><br>
<table cellSpacing=0 cellPadding=0 width="98%" align=center>
    <tbody>
        <tr>
            <td style="LINE-HEIGHT: 150%" colSpan=2>以下是UMLChina 参与制作的一些书籍。 </td>
        </tr>
        <tr>
            <td style="LINE-HEIGHT: 150%" colSpan=2>&nbsp;</td>
        </tr>
        <tr>
            <td style="LINE-HEIGHT: 150%" colSpan=2>
            <p><font color=#ff0000>软件工程</font></p>
            </td>
        </tr>
        <tr>
            <td align=right height=30>
            <div align=center>
            <p><a href="http://www.mmmbook.com/" target=_blank><img height=238 src="http://www.umlchina.com/book/pics/image003.jpg" width=179 border=0></a> <a href="http://www.peoplewarecn.com/" target=_blank><img height=238 src="http://www.umlchina.com/book/pics/image005.jpg" width=184 border=0></a><a href="http://www.china-pub.com/computers/common/info.asp?id=8155" target=_blank><img height=238 src="http://www.umlchina.com/book/pics/image007.jpg" width=173 border=0></a></p>
            <p align=left><img height=14 src="http://www.umlchina.com/images/title.gif" width=13>2002年《人月神话》创下销售记录<br><img height=14 src="http://www.umlchina.com/images/title.gif" width=13>2003年《最后期限》、《人件》、《人月神话》分别排在china-pub年度总销售榜的1、3、4名</p>
            <p align=left>&nbsp;</p>
            </div>
            </td>
            <td align=right height=30>
            <div align=left>
            <p>&nbsp;</p>
            </div>
            </td>
        </tr>
        <tr>
            <td style="LINE-HEIGHT: 150%" colSpan=2>
            <p><font color=#ff0000>需求</font></p>
            </td>
        </tr>
        <tr>
            <td align=right height=30>
            <div align=center>
            <p><img height=200 alt="" src="http://www.umlchina.com/book/pics/masterreq2small.jpg" width=155><img height=200 src="http://www.umlchina.com/book/pics/image013.jpg" width=148 border=0><img height=200 src="http://www.umlchina.com/book/pics/image009.jpg" width=151 border=0></p>
            <p>&nbsp;</p>
            </div>
            </td>
            <td align=right height=30>
            <div align=left>
            <p>&nbsp;</p>
            </div>
            </td>
        </tr>
        <tr>
            <td style="LINE-HEIGHT: 150%" colSpan=2>
            <p><font color=#ff0000>设计</font></p>
            </td>
        </tr>
        <tr>
            <td align=right height=30>
            <div align=center>
            <p><img height=200 alt="" src="http://www.umlchina.com/book/pics/umlembeddedsmall.jpg" width=141> <img height=200 src="http://www.umlchina.com/book/pics/hfdpcover.jpg" width=172> <img height=200 src="http://www.umlchina.com/book/pics/adddp.jpg" width=151></p>
            <p><a href="http://www.china-pub.com/computers/common/info.asp?id=22779" target=_blank><img height=200 src="http://www.umlchina.com/book/pics/dddcover.jpg" width=158 border=0></a> <a href="http://www.china-pub.com/computers/common/info.asp?id=30653" target=_blank><img height=200 src="http://www.umlchina.com/book/pics/oodesign.jpg" width=161 border=0></a> <a href="http://www.china-pub.com/computers/common/info.asp?id=25385" target=_blank><img height=200 src="http://www.umlchina.com/book/pics/umlref.jpg" width=153 border=0></a></p>
            <p><a href="http://www.dearbook.com.cn/book/viewbook.aspx?pno=TS0021971" target=_blank><img height=200 src="http://www.umlchina.com/book/pics/image011.jpg" width=135 border=0></a> <a href="http://www.china-pub.com/computers/common/info.asp?id=19923" target=_blank><img height=200 src="http://www.umlchina.com/book/pics/peaacover.jpg" width=153 border=0></a> <a href="http://www.china-pub.com/computers/common/info.asp?id=28359" target=_blank><img height=200 src="http://www.umlchina.com/book/pics/agiledata.gif" width=152 border=0></a></p>
            </div>
            </td>
        </tr>
    </tbody>
</table>
</font></p>
<img src ="http://www.cppblog.com/ztwaker/aggbug/56761.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-07-21 14:56 <a href="http://www.cppblog.com/ztwaker/archive/2008/07/21/56761.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C++ Tips[ZT]</title><link>http://www.cppblog.com/ztwaker/archive/2008/07/18/56479.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Fri, 18 Jul 2008 01:17:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/07/18/56479.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/56479.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/07/18/56479.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/56479.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/56479.html</trackback:ping><description><![CDATA[<!doctype HTML PUBLIC "-//IETF//DTD HTML//EN">
<html><head><title>C++ Tips </title></head>
<! #################################################################>
<body text="#000000" bgcolor="#FFFFFF" >
<a Name=tip_top></a>
<pre>
                  C++ Tips
                  Sections
            Intro
            I.   ABCs and Inheritance
            II.  Scope
            III. CLASSES
            IV.  MISC
            V.   OVERLOADING
            VI.  PARAMETERS
            VII. Constructors (more on classes)
            VIII.EXCEPTIONS
            IX.  TEMPLATES (more on classes)

Intro
This is not a code guideline document. See the C++ Style Guide for guidelines.
This is more of a document to fuel questions while you design and code
with C++. In some cases the point is simply stated and probably comes
off as a rule. In reality, they are simply meant as rules of thumb.
One of the main problems in C++ (more so than C) is that C++ provides
many mechanisms in the language by which the same task can be achieved
through different policies.  For example, C++ has the Polymorphism mechanism.
Some of the policies are templates, macros, inheritance, overloading,
(those are the static, compile-time ones), and virtual functions (the
run-time polymorphic policy).  Hopefully the following will provide 
enough fuel for questions to arrive at the best policy to use for a 
particular design.

I. ABCs and Inheritance
-----------------------
1. Abstract Base Class (ABC) : Make ABC class constructor protected when
      possible. Derived classes can have public constructor to override
      this.  The same is true for non-ABC classes as well.
2. Class Inheritance : Use protected keyword where ever possible, never use
      public to expose data members so the inheriting classes have access
      to them.
3. Multiple Inheritance and VBC's :The only drawback is the most derived
      class must initialize the lowest base classes. This breaks
      encapsulation.  Most people view multiple inheritance as a bad
      thing, but when used sparingly for parts of a design, there is
      no problem with it.
4. Data in classes should be keep private as much as possible.  Use a
      member function if a client needs to access the data.  If a member
      function does not need to be seen by a client, make it private.
      If the class might be inherited, then protected may be a good choice.
5. Private inheritance: Don't use it.  Too many ambiguities when used with
      run-time type identification.  Use a private data member instead
      or use public inheritance.
      Example:      class Foo: private Bar { ... }      dont do

6. Inheritance & virtual overrides: Care must be taken in overriding
      inherited functions. Sometimes functions are grouped together,
      and all need to be overridden. The base class designer must make
      this clear, if overriding one function requires multiple 
      functions to be overridden.
7. Inheritance & Get/Set functions: Typically functions that perform
      Get/Set shouldn't be overridden unless they are used by
      the derived class. Otherwise if the base class does direct
      field manipulation, you usually can't override it correctly,
      or it could be a maintenance nightmare.
      Note: Get/Set functions as referred to above are merely meant as
      abstractions. As a rule of thumb (thumb must be getting pretty
      big by now), one should not create functions called Get or Set,
      or flavors thereof. They tend to break the spirit of encapsulation.
      Of course, there will be times to use them.

II. SCOPE
---------
1. Law of Demeter : Do not make references to classes in a class that are
      not variables of the class, inherited by the class, or global.
      This also applies to including header files.
      Example:
            class Foo{public: Go(){} };
            class Bar{ Foo aFoo;  public:       Foo GetFoo(){return aFoo;} };
            class Fubar{ public:
                        void Bad(){  Bar aBar;  aBar.GetFoo().Go(); }
            };
      The method Bad() breaks encapsulation. It calls a method of a class
      it probably does not need to know about.  This will also affect 
      maintainability. If the Foo class changes, the changes may also 
      need to be done in the Fubar class.  
      The other side of the coin that must be looked at is do you
      want a pass-through method in the Bar class that simply
      calls the Go() method of the Foo class.  Lots of silly simple
      1 line member functions may not be desirable in all the classes.
      What probably needs to be looked at to decide what road to take
      is speed, or perhaps redesign the classes.
      Beyond the Law of Demeter is Doug's rule of thumb: Don't
      play hide and seek with data.
2. Scope: Another way to say the previous point is to keep scope
      small. This will increase the lifetime of the code and keep it
      maintainable and safe.
III. CLASSES
------------
1. Be explicit about the keywords, public, protected, and private in a class
      interface. Try not to have multiple sections. In other words, 
      multiple private sections in the class interface.  It is generally
      a good idea to place the public section first because this is 
      what most people are looking for when they go to use a class.
2. Make classes as atomic as possible. Give them a clear purpose. Break
      them into smaller classes if they become too complex. This may
      also eliminate duplicate code.
3. Don't let the compiler generate the default constructor,destructor,
      operator= and copy constructor.  If the class is entirely value
      based, this is probably fine, if not, for example, if the class
      has a data member that is a pointer, the above will probably not
      work.  Note, the default copy constructor only does a memcpy
      of the class, so all you copy is the pointer data. This may not
      be sufficient for copying a class.  Regardless, if you do want the
      default ones, place them in the code, and leave them commented.
      For example:
            // Fubar(const Fubar&)   use default copy constructor
4. If your class contains pointers, you should create the default constructor
      destructor, operator=, and copy constructor.
5. Class Copy: If the class should never be copied, then place the copy
      constructor in the private section and don't implement it.
      The linker will catch this, and the program will fail to build.
      This, although not graceful, is better than a malformed program.
6. Initialization: Perform all data member initialization in the constructor.
      It's best not to leave uninitialized objects running around in 
      the system.  Note, it is often more efficient using the
      constructor initializer list, otherwise, the default constructor
      would be called, and then you probably call member functions of
      the object later in the constructor.  For example:
      class Foo{ Bar mung;  Foo(int iCount) : mung(iCount) {}  ... };
      The variable mung is initialized once. But in the following:
      class Foo{ Bar mung;  Foo(int iCount){ mung = iCount; }  ... };
      mung's default constructor is called before the body of the
      class Foo's constructor is entered. Then mung is set again -
      this assumes that mung has an assignment operator. The net
      effect is that mung is initialized twice.
7. Class Naming:  There exists several ways to name classes that seem to
      work well for certain groups or people.  There is Hungarian notation
      and the "Taligent's Guide to Designing Programs" that document some
      of the more typical methods.

IV. MISC
--------
1. Implicit int:  The 'implicit int' rule will go away in the next 
      C++ standard. So for a proto like:  'main()'  you will have to 
      say 'int main()' in the future. Same for variables.
2. Preprocessor: Avoid it.  Use const values in the class, or inline
      functions instead of macros.  This is not to say, never use any
      #defines.
      Main reason:      #define MIN(a,b)      ( (a<b) ? a : b )
                  int iA=9, iB=10;
                  MIN(iA++,iB) ;
                  cout << iA ;
                  // What do you think gets printed ? // 11 si rewsna
3. Global variables: These can be cleverly avoided in C++. You can have
      static data inside a class to represent global data, and possibly
      static member functions to access the data.  The class could be
      made a global object if necessary, and in this case you do not 
      have to make the member functions static.

4. Don't forget the value of C++'s built-in types.  I'm not amused by
      a class Int, Double, Float. I think the built-in types work
      pretty well without it. Why would one sacrifice speed for this.
      typedefing something as one of the scalar types is fine, just
      making classes out of them is wrong.
5. Build in const correctness.  Add const to member functions that do
      not modify any data in the class.  Also for parameter passing,
      use const as much as possible.  For example:
            const char* Fubar( const Bar & rb) const;
6. Loop Initialization: Be careful with initializations in loops. For 
      example:
            for (int ii = 0; ii <10 ; ii++)
                  ;
            cout ii;
      The latest C++ standard limits the scope of ii to only the for loop.

7. Mutable:  Don't use the mutable keyword. You can design around this.
8. Friends: friends should be kept to a minimum. Nothing personal! Re-design
      as necessary.  Use inheritance, encapsulation, classes within classes.

9. Forward Declaration:  If a class, we'll say class Foo, only has a
      pointer to an object of another class, class Bar, in the interface
      file (header file) for class Foo,  forward declare class Bar in
      the interface file.  Then, in the .cc file (implementation file)
      include the header file for class Bar. This way, classes or clients
      of the Foo class don't drag in unnecessary header files in order to
      compile.  If you are referencing a Bar object, rather than just
      a pointer to it, then include the header file for the Bar class.
      Example:
      // Header for class Foo
      class Bar;      //forward declaration of class Bar
      class Foo{
      public:
            Foo ( Bar* pbarNew);
      };
      // Implementation (.cc) file for class Foo
      #include "foo.hh"
      #include "bar.hh"
      Foo::Foo(Bar* pbarNew) { pbarNew->SomeFunction(); }

V. OVERLOADING
--------------
1. operator overloading:  It's syntactic sugar. Don't add them if they
      are not needed.  This does NOT refer to the typical ones like
      '=', '==', but ones like '()', '[]', '+'.  It does not always 
      make sense to add two objects together.

2. Overloading:  If a member function is conditionally executing code, 
      it may be a candidate for operator overloading, or just overloading.
3. Operator overloading and chaining: When designing an overloaded
      operator, think about whether it needs to be chained. For example:
            String cstr = "a" + "b" + "c";
      The String class's operator returns a reference to the String class.
      A partial implementation might be:
      
      class String{ public:
      String& operator+(const char *pcBuf){ 
                  // code to add the char* to the string
                  return *this;
      }
            ...
      };

VI. PARAMETERS
--------------
1. Argument Passing:  The first choice is typically a const ref.  The 
      const ref is basically an alias, and is easier to use than a 
      pointer.  It creates the same amount of instruction code as passing
      a pointer (for most cases). It's typically better than passing
      by value, where an object constructor will be called (if its an
      object).  As a rule of thumb, you might want too give the following
      a whirl:
            IN      const &
            OUT      &            If the object has the support functs
            INOUT      *&            Acts like a **.
      So for an IN parameter, what the 'const &' says, is here is a 
      reference to it, but you cannot modify the object. But you can
      call member functions that do not change the object ( member
      functions defined as const).  The OUT parameter is a parameter
      that is passed to a function that will modify it.  If the parameter
      needs to be created, then the INOUT parameter of *& may be a
      good choice.
2. Returning Ref:  In functions that return a reference, remember not to
      reference a temporary object and return it.  For example:
            String &Zippo(void){ ....  return String();
      What happens, is that the String() is a temporary object that
      upon return goes out of scope and is destroyed.  Thus, you
      return a reference to a destroyed object. Unfortunately, the
      program will probably work in most cases till it's shipped.
      The ol' Heisenbug!
3. Ref vs Pointer: Here's another way to look at when to use references,
      and when should to use pointers.
      C programmers sometimes don't like references since the
      reference semantics they provide isn't *explicit* in the caller's
      code. After a bit of C++ experience, however, one quickly realizes
      this "information hiding" is an asset rather than a liability. In
      particular, reuse-centered OOP tends to migrate the level of
      abstraction away from the language of the machine toward the
      language of the problem.  References are usually preferred over
      ptrs whenever you don't need "re-seating". This usually means that
      references are most useful in a class' public interface. References
      then typically appear on the skin of an object, and pointers on the
      inside. The exception to the above is where a function's parameter
      or return value needs a "sentinel" reference. This is usually best
      done by returning/taking a pointer, and giving the nil ptr (0) this
      special significance (references should always alias *objects*, not
      a dereferenced nil ptr).

VII. Constructors (more on classes)
-----------------------------------
1. Creating Constructors: These creatures should be simple. Try not to
      do anything in them that may generate errors.  Remember they
      don't have return values. If it's necessary to allocate
      memory or other complex things in the constructor, throw an exception
      if possible as the first recourse. Else, the class will have to be
      protected everywhere that may use something that may be in error.
      It's generally not a pretty sight to see an error returned in the
      constructor's signature.
2. Constructors: Another reason to keep them simple is in the case
      of inheritance.
3. Destructors:  It's responsibility is to release resources allocated 
      during the class's lifetime, not just from construction.
4. Member Initialization List: The constructor can have a comma separated
      member initialization list. If a class contains value based classes
      as data members, they can be initialized in the constructor. For
      example:
      class Foo{
            String cstr1;      // value based class called String
            String cstr2;      // value based class called String
      public:
            Foo(const char* pcStr1, const char*pcStr2):
                  cstr1(pcStr1), cstr2(pcStr2){}
      };
      With the variables cstr1, and cstr2 initialized in the constructor,
      they are initialized only once. Else, if they were initialized in 
      the body of the constructor, they would first be initialized with
      a default constructor, then again in the body.
      
VIII. EXCEPTIONS
----------------
1. Exceptions: Use exception hierarchies, possibly even derived from the
      Standard C++ ones.
2. Exceptions: Throw exceptions by value and catch them by reference.
      This way the exception handling mechanism cleans up anything
      created on the heap. If you throw exceptions by pointer, the
      catcher must know how to destroy them.  This is probably not
      a good coupling.  Even so, any up casting may slice and dice the
      object.

IX. TEMPLATES (more on classes)
-------------------------------
1. Templates:  Before creating new ones, see if they are in RogueWave,
      or part of the C++ Standard.
2. Templates:  When creating them, try to filter out any code that
      does not depend on the type, and place that into a base class.
      Thus, the template class itself is only the necessary information
      that depends on type. Good examples can be found in RogueWave.
</pre>
<! #################################################################>
<p><hr SIZE="5" WIDTH="100%">
<address>Douglas J. Waters
<address>(best reached on the internet)
<address>Internet: waters@openmarket.com
<address>Phone: (781) 359-7220
</body>
</html><img src ="http://www.cppblog.com/ztwaker/aggbug/56479.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-07-18 09:17 <a href="http://www.cppblog.com/ztwaker/archive/2008/07/18/56479.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[轉]C++程序设计最佳实践</title><link>http://www.cppblog.com/ztwaker/archive/2008/07/16/56317.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Wed, 16 Jul 2008 09:12:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/07/16/56317.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/56317.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/07/16/56317.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/56317.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/56317.html</trackback:ping><description><![CDATA[<div class=tit>[轉]C++程序设计最佳实践</div>
<div class=date>2007年04月23日 星期一 00:57</div>
<table style="TABLE-LAYOUT: fixed">
    <tbody>
        <tr>
            <td>
            <div class=cnt id=blog_text>
            <p><span class=large><font color=#000000>　　随着计算机语言的发展，我们现在编写一个程序越来越容易了。利用一些软件开发工具，往往只要通过鼠标的拖拖点点，计算机就会自动帮你生成许多代码。但在很多时候，计算机的这种能力被滥用了，我们往往只考虑把这个程序搭起来，而不去考虑程序的性能如何，程序是否足够的健壮。而此节课的目的主要是介绍一些编码的经验，让大家编写的程序更加健壮和高性能。<br><br>　　1、Prefer const and inline to #define <br><br>　　在C++编程中应该尽量使用const和inline来代替#define，尽量做到能不用#define就不用。#define常见的用途有&#8220;定义常量&#8221;以及&#8220;定义宏&#8221;，但其中存在诸多的弊病。 <br><br>　　第一，查错不直观，不利于调试。Define的定义是由预处理程序处理的，作的是完全的文本替换，不做任何的类型检查。在编译器处理阶段，define定义的东西已经被完全替换了，这样在debug的时候就看不到任何的相关信息，即跟踪时不能step into宏。例如，把ASPECT_RATIO用define定义成1.653，编译器就看不到ASPECT_RATIO这个名字了。如果编译器报1.653错，那么就无从知道此1.653来自于何处。在真正编码的时候应该使用如下的语句来定义：<br><br><br>static const double ASPECT_RATIO = 1.653;<br><br>　　第二，没有任何类型信息，不是type safe。因为它是文本级别的替换，这样不利于程序的维护。<br><br>　　第三，define的使用很容易造成污染。比如，如果有两个头文件都定义了ASPECT_RATIO, 而一个CPP文件又同时包含了这两个头文件，那么就会造成冲突。更难查的是另外一种错误，比如有如下的代码：<br>　　// in header file def.h<br>　　#define Apple 1<br>　　#define Orange 2<br>　　　 #define Pineapple 3 <br>　　 &#8230;<br>　　// in some cpp file that includes the def.h<br>　　enum Colors {White, Black, Purple, Orange};<br><br>　　在.h文件中Orange被定义成水果的一种，而在.cpp文件中Orange又成为了一种颜色，那么编译器就会把此处的Orange替换成2，编译可能仍然可以通过，程序也能够运行，但是这就成了一个bug，表现出古怪的错误，且很难查错。再比如定义了一个求a与b哪个数大的宏，#define max(a,b) ((a) &gt; (b) ? (a) : (b))<br>　　int a = 5, b = 0; <br>　　max(++ a, b); <br>　　max(++ a, b + 10);<br><br>　　在上面的操作中，max(++ a, b); 语句中a被++了两次，而max(++ a, b + 10); 语句中a只加了一次，这样在程序处理中就很有可能成为一个bug，且此bug也非常的难找。在实际编码时可以使用如下的语句来做：<br>　　template<class></class> <br>　　inline const T&amp; <br>　　max(const T&amp; a, const T&amp; b) { return a &gt; b ? a : b; }<br><br>　　2、Prefer C++-style casts <br><br>　　在程序中经常会需要把一种类型转换成另外一种类型，在C++中应该使用static_cast、const_cast、dynamic_cast、reinterpret_cast关键字来做类型转换。因为这有以下好处，一是其本身就是一种注释，在代码中看到上面这些关键字就可马上知道此处是进行类型转换。二是C语言中类型转换通常是很难进行搜索的，而通过关键字cast则可以很容易的找到程序中出现类型转换的地方了。<br><br>　　3、Distinguish between prefix and postfix forms of increment and decrement operators <br><br>　　通常对于操作系统或编译器自身支持的类型，prefix（前缀，如++i）与postfix（后缀，如i++）的效果是一样的。因为现在的编译器都很聪明，它会自动做优化，这两者的汇编代码是一样的，性能不会有差别。但有时候也会有不同的，如一些重载了操作符的类型。下面是模拟prefix与postfix的操作过程，可以发现在postfix操作中会生成一个临时变量，而这一临时变量是会占用额外的时间和开销的。<br>　　// prefix form: increment and fetch<br>　　UPInt&amp; UPInt::operator++() <br>　　　{ <br>　　　 *this += 1; // increment <br>　　　return *this; // fetch <br>　　　} <br>　　// postfix form: fetch and increment <br>　　　const UPInt UPInt::operator++(int) <br>　　　{<br>　　　 UPInt oldValue = *this; // fetch<br>　　　++(*this); // increment <br>　　　 return oldValue; // return what was fetched<br>　　 }<br><br>　　一般情况下不需要区分是先++，还是后++，但是我们在编写程序的时候最好能习惯性的将其写成++i的形式，如在使用STL中的iterator时，prefix与postfix会有相当大的性能差异。请不要小看这些细节，实际在编写程序的时候，若不注意具体细节，你会发现程序的性能会非常的低。但要注意，虽然在大多数情况下可以用prefix来代替postfix，但有一种情况例外，那就是有[]操作符时，比如gzArray [++index] 是不等于 gzArray[index++]的。</font></span></p>
            <p><span class=large>4、Minimizing Compile-time Dependencies <br><br>　　有些人在编写程序时，往往喜欢将一个.h文件包含到另一个.h文件，而实践证明在做大型软件时这是一个非常不好的习惯，因这样会造成很多依赖的问题，包含较多的.h文件，别人又使用了这个class，而在他的那个工程中可能并不存在这些.h文件，这样很可能就编译不能通过。而且这样做，还可能造成很难去更新一个模块的情况。因为一个.h文件被很多模块包含的话，如果修改了此.h文件，在编译系统的时候，编译器会去寻找哪些模块依赖于某个被修改过的.h文件，那么就导致了所有包含入此.h文件的模块全都要进行重新编译。在项目比较小的时候，大家可能还感觉不到差别，但是如果说是在大型的软件系统里，你可能编译一遍源码需要七、八个小时。如果你这个.h文件被很多模块包含的话，就算在.h文件中加了一行注释，在编译时编译器检查哪些文件被改动，那么所有包含入此.h文件的模块都会被重新编译，造成巨大的时间和精力负担。对于此问题，解决的方法就是让.h文件自包含，也就是说让它包含尽量少的东西。所谓尽量少是指如删掉任何一个它包含进来的.h文件，都将无法正常进行工作。其实在很多情况下，并不需要一个.h文件去包含另一个.h文件，完全可以通过class声明来解决依赖关系的这种问题。再来看下面这个例子：<br>　　#include "a.h" // class A<br>　　#include "b.h" // class B<br>　　#include "c.h" // class C<br>　　#include "d.h" // class D<br>　　#include "e.h" // class E<br>　　class X : public A, private B<br>　　{<br>　　　public:<br>　　E SomeFunctionCall(E someParameter); <br>　　　private:<br>　　 D m_dInstance;<br>　　};<br><br>　　当类X从类A和类B中派生时，需要知道X在内存中都有哪些data，通常在内存中前面是基类的data，后面紧跟的是此派生类自身定义的data，因此就必须知道类A与类B的内部细节，要不然编译器就无法来安排内存了。但是在处理参数以及参数返回值的时候，实际上并不需要知道这些信息，在此处定义的SomeFunctionCall()只需知道E是个class就足够了，并不需要知道类E中的data如长度等的具体细节。上面的代码应该改写成如下的形式，以减少依赖关系：<br>　　#include "a.h" // class A<br>　　#include "b.h" // class B<br>　　#include "c.h" // class C<br>　　#include "d.h" // class D<br>　　class E;<br>　　class X : public A, private B<br>　　{<br>　　　public:<br>　　E SomeFunctionCall(E someParameter); <br>　　　private:<br>　　D m_dInstance;<br>　　}; <br><br>　　5、Never treat arrays polymorphically <br><br>　　不要把数组和多态一起使用，请看下面的例子。<br>　　class BST { ... }; <br>　　class BalancedBST: public BST { ... }; <br>　　void printBSTArray(ostream&amp; s, const BST array[], int numElements) <br>　　{ <br>　　for (int i = 0; i &lt; numElements; ++i) <br>　　{ <br>　　 s &lt;&lt; array[i]; <br>　　// this assumes an operator&lt;&lt; is defined for BST<br>　　} <br>　　}<br><br>　　BalancedBST bBSTArray[10]; <br>　　printBSTArray(cout, bBSTArray, 10); <br><br>　　数组在内存中是一个连续的内存空间，而在数组中应该如何来定位一个元素呢？过程是这样的，编译器可以知道每个数据类型的长度大小，如果数组的index是0，则会自动去取第一个元素；如果是指定了某个index，编译器则会根据此index与该数据类型的长度自动去算出该元素的位置。<br><br>　　在printBSTArray()函数中，尽管传入的参数是BalancedBST类型，但由于其本来定义的类型是BST，那么它依然会根据BST来计算类型的长度。而通常派生类实例所占的内存要比基类实例所占的内存大一些，因此该程序在编译时会报错。请记住，永远不要把数组和C++的多态性放在一起使用。<br><br>　　6、Prevent exceptions from leaving destructors <br><br>　　析构函数中一定不要抛出异常。通常有两种情况会导致析构函数的调用，一种是当该类的对象离开了它的域，或delete表达式中一个该类对象的指针，另一种是由于异常而引起析构函数的调用。<br><br>　　如果析构函数被调用是由于exception引起，而此时在析构函数中又抛出了异常，程序会立即被系统终止，甚至都来不及进行内存释放。因此如果在析构函数中抛出异常的话，就很容易混淆引起异常的原因，且这样的软件也会让用户非常恼火。由于析构函数中很可能会调用其它的一些函数，所以在写析构函数的时候一定要注意，对这些函数是否会抛出异常要非常清楚，如果会的话，就一定要小心了。比如下面这段代码：<br>　　Session::~Session() <br>　 { <br>　　logDestruction(this);<br>　 } <br><br>　　比如logDestruction()函数可能会抛出异常，那么我们就应该采用下面这种代码的形式： <br>　　Session::~Session() <br>　 { <br>　　 try <br>　　{<br>　　　logDestruction(this); <br>　　 }<br>　　 catch (...) <br>　　{ <br>　　 } <br>　} <br><br>　　这样程序出错的时候不会被立即关掉，可以给用户一些其它的选择，至少先让他把目前在做的工作保存下来。<br><br>　　7、Optimization:Remember the 80-20 rule <br><br>　　在软件界有一个20-80法则，其实这是一个很有趣的现象，比如一个程序中20%的代码使用了该程序所占资源的80%；一个程序中20%的代码占用了总运行时间的80%；一个程序中20%的代码使用了该程序所占内存的80%；在20%的代码上面需要花费80%的维护力量，等等。这个规律还可以被继续推广下去，不过这个规律无法被证明，它是人们在实践中观察得出的结果。从这个规律出发，我们在做程序优化的时候，就有了针对性。比如想提高代码的运行速度，根据这个规律可以知道其中20%的代码占用了80%的运行时间，因此我们只要找到这20%的代码，并进行相应的优化，那么我们程序的运行速度就可以有较大的提高。再如有一个函数，占用了程序80%的运行时间，如果把这个函数的执行速度提高10倍，那么对程序整体性能的提高，影响是非常巨大的。如果有一个函数运行时间只占总时间的1%，那就算把这个函数的运行速度提高1000倍，对程序整体性能的提高也是影响不大的。所以我们的基本思想就是找到占用运行时间最大的那个函数，然后去优化它，哪怕只是改进了一点点，程序的整体性能也可以被提高很多。<br><br>　　要想找出那20%的代码，我们的方法就是使用Profiler，它实际上是一些公司所开发的工具，可以检查程序中各个模块所分配内存的使用情况，以及每个函数所运行的时间等。常见的Profiler有Intel公司开发的VTune，微软公司开发的Visual Studio profiler，DevPartner from Compuware等。 </span></p>
            </div>
            </td>
        </tr>
    </tbody>
</table>
<img src ="http://www.cppblog.com/ztwaker/aggbug/56317.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-07-16 17:12 <a href="http://www.cppblog.com/ztwaker/archive/2008/07/16/56317.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>德鲁克的著作列表</title><link>http://www.cppblog.com/ztwaker/archive/2008/07/14/56087.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Mon, 14 Jul 2008 04:44:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/07/14/56087.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/56087.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/07/14/56087.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/56087.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/56087.html</trackback:ping><description><![CDATA[德鲁克的著作列表（中文译名会因各出版社不同而不同，请以英文名称为准）：<br>1.&nbsp; 《经济人的末日》（The End of Economic Man ）- 1939<br>2.&nbsp; 《工业人的未来》（The Future of Industrial Man） - 1942<br>3.&nbsp; 《公司的概念》（Concept of the Corporation） - 1946<br>4.&nbsp; 《新社会》（The New Society） - 1950<br>5.&nbsp; 《个人推荐首批阅读》《管理实践》（The Practice of Management） - 1954<br>6.&nbsp; 《美国的下一个20年》（America's Next Twenty Years） - 1957<br>7.&nbsp; 《明日的里程碑》（Landmarks of Tomorrow） - 1957<br>8.&nbsp; 《成果管理》（Managing for Results ）- 1964<br>9.&nbsp; 《个人推荐首批阅读》《卓有成效的管理者》（The Effective Executive） - 1966<br>10. 《断层时代》（The Age of Discontinuity） - 1968<br>11. 《技术、管理与社会》（Technology， Management and Society） - 1970<br>12. 《人、思想与社会》（Men， Ideas and Politics） - 1971<br>13. 《个人推荐首批阅读》《管理：任务、责任、实践》（Management: Tasks， Responsibilities， Practices） - 1973<br>14. 《看不见的革命》（The Unseen Revolution） - 1976 (1996年以《退休基金革命》（The Pension Fund Revolution）重版)<br>15. 《人与绩效：德鲁克论管理精华》（People and Performance: The Best of Peter Drucker on Management ）- 1977<br>16. 《管理导论》（An Introductory View of Management） - 1977<br>17. 《旁观者》（Adventures of a Bystander） - 1978<br>18. 《毛笔之歌：日本绘画》（Song of the Brush: Japanese Painting from the Sanso Collection） - 1979<br>19. 《动荡时代中的管理》（Managing in Turbulent Times） - 1980<br>20. 《迈向经济新纪元及其他论文》（Toward the Next Economics and Other Essays） - 1981<br>21. 《变动中的管理界》（The Changing World of the Executive） - 1982<br>22. 《最后可能出现的世界》（小说，The Last of All Possible Worlds） - 1982<br>23. 《行善的诱惑》（小说，The Temptation to Do Good ）- 1984<br>24. 《创新与企业家精神》（Innovation and Entrepreneurship） - 1985<br>25. 《管理的前沿》（Frontiers of Management: Where Tomorrow's Decisions are Being Shaped Today） - 1986<br>26. 《新现实：政府与政治、经济与企业、社会与世界》（The New Realities: in Government and Politics， in Economics and Business， in Society and World View） - 1989<br>27. 《非营利组织的管理：原理与实践》（Managing the Nonprofit Organization: Principles and Practices） - 1990<br>28. 《为了未来－20世纪90年代及其以后的年代－而管理》 &#8220;Mananing for the Future:The 1990's and Beyond&#8221; - 1992<br>29. 《生态远景》（The Ecological Vision） - 1993<br>30. 《后资本主义社会》（Post-Capitalist Society） - 1993<br>31. 《巨变时代的管理》（Managing in a Time of Great Change） - 1995<br>32. 《德鲁克看亚洲：德鲁克与中内的对话》（Drucker on Asia: A Dialogue between Peter Drucker and Isao Nakauchi） -1997<br>33. 《德鲁克论管理》（Peter Drucker on the Profession of Management） - 1998<br>34. 《21世纪的管理挑战》（Management Challenges for the 21st Century ）- 1999<br>35. 《德鲁克精华》（The Essential Drucker） - 2001<br>36. 《下一个社会的管理》（Managing in the Next Society） - 2002<br>37. 《功能社会》（A Functioning Society ）- 2002<br>38. 《个人推荐首批阅读》《德鲁克日志》（The Daily Drucker） - 2004<br>39. 《卓有成效管理者的实践》 （The Effective Executive in Action）-2006<br>
<img src ="http://www.cppblog.com/ztwaker/aggbug/56087.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-07-14 12:44 <a href="http://www.cppblog.com/ztwaker/archive/2008/07/14/56087.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Software quality</title><link>http://www.cppblog.com/ztwaker/archive/2008/06/17/53703.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Tue, 17 Jun 2008 07:06:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/06/17/53703.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/53703.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/06/17/53703.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/53703.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/53703.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Software qualityFrom Wikipedia, the free encyclopediaJump to: navigation, search                                                            This article may require cleanup to ...&nbsp;&nbsp;<a href='http://www.cppblog.com/ztwaker/archive/2008/06/17/53703.html'>阅读全文</a><img src ="http://www.cppblog.com/ztwaker/aggbug/53703.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-06-17 15:06 <a href="http://www.cppblog.com/ztwaker/archive/2008/06/17/53703.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>杰拉尔德·温伯格（Gerald M. Weinberg）</title><link>http://www.cppblog.com/ztwaker/archive/2008/06/17/53698.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Tue, 17 Jun 2008 06:08:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/06/17/53698.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/53698.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/06/17/53698.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/53698.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/53698.html</trackback:ping><description><![CDATA[<center>
<table cellSpacing=0 cellPadding=0 width=770 border=0>
    <tbody>
        <tr>
            <td width=200 height=71><img height=71 src="http://www.weinbergcn.com/images/book101.jpg" width=200></td>
            <td width=200><img height=71 src="http://www.weinbergcn.com/images/book102.jpg" width=200></td>
            <td width=200><img height=71 src="http://www.weinbergcn.com/images/book103.jpg" width=200></td>
            <td width=170><img height=71 src="http://www.weinbergcn.com/images/book104.jpg" width=170></td>
        </tr>
        <tr>
            <td colSpan=2 height=36><img height=36 src="http://www.weinbergcn.com/images/book201.jpg" width=400></td>
            <td vAlign=bottom background=images/book202.jpg colSpan=2>
            <table cellSpacing=0 cellPadding=0 border=0>
                <tbody>
                    <tr>
                        <td width=199 height=18><br></td>
                        <td width=79><a href="http://www.weinbergcn.com/index.html"><img height=13 src="http://www.weinbergcn.com/images/book203.gif" width=26 border=0></a></td>
                        <td width=94><a href="http://www.weinbergcn.com/series.html"><img height=13 src="http://www.weinbergcn.com/images/book204.gif" width=26 border=0></a></td>
                        <td width=60><a href="http://www.smiling.com.cn/group/homepage.ecgi?group_id=45341" target=_blank><img height=13 src="http://www.weinbergcn.com/images/book207.gif" width=39 border=0></a></td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
<table cellSpacing=0 cellPadding=0 width=770 border=0>
    <tbody>
        <tr>
            <td bgColor=#a7dff7 height=18></td>
        </tr>
    </tbody>
</table>
<!---------------->
<table cellSpacing=0 cellPadding=0 width=770 border=0>
    <tbody>
        <tr>
            <td align=middle bgColor=#a7dff7><!----------建立你自己的温伯格图书馆------------>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=14 background=images/book602.gif height=24><img height=3 src="http://www.weinbergcn.com/images/book601.gif" width=3 border=0></td>
                        <td style="FONT-WEIGHT: bold; COLOR: #ffffff" width=200 background=images/book602.gif><strong>建立你自己的温伯格图书馆</strong></td>
                        <td width=8><img height=24 src="http://www.weinbergcn.com/images/book603.gif" width=8 border=0></td>
                        <td width=409 background=images/book604.gif><br></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=1 cellPadding=5 width=631 bgColor=#000000 border=0>
                <tbody>
                    <tr>
                        <td style="LINE-HEIGHT: 18px" bgColor=#a7dff7><br>&nbsp;&nbsp;&nbsp;&nbsp;9月，清华大学出版社隆重推出了《软件与系统思想家温伯格精粹译丛》首批共6种。该丛书共14种，均出自美国计算机界的泰斗人物杰拉尔德&#183;温伯格（Gerald M. Weinberg）。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;温伯格首要的贡献集中于软件领域，他是从个体心理、组织行为和企业文化角度研究软件管理和软件工程的权威和代表人物。在超过40年的软件职业生涯中，温伯格从事过软件开发，软件项目管理、软件管理教学和咨询，他更是一位杰出的软件专业作者和思想家。1997年，温伯格因其在软件领域的杰出贡献，被美国计算机博物馆的计算机名人堂选为首批5位成员之一。这个名人堂至今只有20名成员。为中国读者所熟悉的比尔&#183;盖茨和迈克尔&#183;戴尔也是在温伯格之后方才获得这一计算机界至高无上的殊荣。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;温伯格精力旺盛、思想活跃，从20世纪70年代开始，他总共撰写了30多本书籍和数以百计的论文。这些著作主要集中在两个主题：人与技术的结合；人的思维模式、思维习惯以及解决问题的方法。温伯格的大部分作品已经被翻译成10多种语言发行到法国、德国、西班牙、葡萄牙、荷兰、俄罗斯、日本等多个国家，30余年畅销不衰。在西方国家乃至全世界，温伯格拥有大量忠实的读者群，这些"追星族"阅读了温伯格的每本重要著作，他们甚至建设有专门的组织和网站，讨论和交流大师的重要思想。可以说，温伯格近年来的每本新书都是在万众瞩目中推出的。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;成熟的软件产业是管理实践和信息技术结合的产业。而软件管理思想的引进，比技术和资金更为紧迫和重要。在西方国家图书市场上，软件管理图书非常多。浪里淘沙之中，温伯格的著作正是西方软件管理思想发展和集大成的中流砥柱。 <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--美国计算机名人堂代表人物温伯格的思想精华 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--微软亚洲研究院院长兼首席科学家张亚勤强力推荐 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--12种语言的版本发行全世界，30余年畅销不衰 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--提倡人与技术相结合、引导系统化思维模式 <br></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><a href="http://www.china-pub.com/computers/subject/huodong/Weinberg/xinli.html" target=_blank><img class=img height=150 src="http://www.weinbergcn.com/cover/xinli.gif" width=100 border=0></a></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=400 border=0>
                            <tbody>
                                <tr>
                                    <td class=title onmouseover='isdiv("div0",1)' onmouseout='isdiv("div0",0)' height=20>程序开发心理学（银年纪念版）</td>
                                </tr>
                                <tr>
                                    <td>
                                    <div id=div0 style="VISIBILITY: hidden; POSITION: absolute">
                                    <table cellSpacing=1 cellPadding=5 width=600 bgColor=#000000 border=0>
                                        <tbody>
                                            <tr>
                                                <td style="LINE-HEIGHT: 18px" bgColor=#fbfde6>&#8730; "这是有史以来计算机编程领域的最经典的一部著作。"--Datamation <br>&#8730; "一本杰作的新生！&#8230;&#8230;1971年，当《程序开发心理学》首次面世时，我们都如雷轰耳--从未有人提出软件开发可以被看作是一种人类的活动。经历多年，该书成为全球畅销书&#8230;&#8230;不管你是属于上世纪60年代和70年代那一代，还是属于80年代和90年代的新一代，你要感谢你自己去拿起这样一本奇妙的书。一旦你读了它，你应该接着追读Weinberg所有其他的书，每一本都是一颗宝石。"--Ed Yourdon, Cutter IT Journal <br>&#8730; "《程序开发心理学》&#8230;&#8230;是第一本强调计算机编程是个人和团队共同努力过程的图书，并且成为了这个领域的经典图书&#8230;&#8230;尽管本书写作时采用的是1971年的视角，但是30多年后的今天，这本书还是所有软件开发经理们的必读经典。"--J.J.Hirschfelder，Computing Reviews <br>&#8730; "Gerald M. Weinberg是我的良师益友，我的同行，也是我们这个职业（软件开发）造就的最好的思想家和作者&#8230;&#8230;《程序开发心理学》一书写成于1969年，1971年出版，自此被不断重印，其重印记录是任何其他计算图书都未能比及的。大多数书中的'关于人的内容'比其中的技术更经得住时间的考验。"--Sue Petersen在Visual Developer Magazine（March/April, 1999）的评论 <br>&#8730; "Gerald M. Weinberg的《程序开发心理学》 是我最喜爱的一本关于软件开发的书。&#8230;&#8230;书中的有关'无私软件开发'的观点&#8230;&#8230;带动了开放源码思想崛起。好的软件工程思想要比具体的技术更经久不衰。就这一点而言，没有一本书提供的思想可以与《程序开发心理学》中的思想相比。"--Steve McConnel，IEEE主编，IEEE Software (Jan/Feb, 1999) <br>&#8730; "Gerald M. Weinberg的经典之作《程序开发心理学》影响了我的一生&#8230;&#8230;因为他认识到了一个随着时间推移将变得越来越重要的问题：关注和培育程序员和程序员队伍。&#8230;&#8230;和Fredrick Brooks的《人月神话》一样，Weinberg的《程序开发心理学》同样是一本经久不衰的经典之作。"--Michael Schrage，MIT Media Lab，"No More Teams!"一书的作者，摘自Computerworld <br>&#8730; "《程序开发心理学》（银年纪念版）是1971年该书第一次出版后的修订本。这本书如何还能适合今天人们的口味呢？答案很简单：人并没有真正改变。&#8230;&#8230;Weinberg在全书提供了无数强有力的经历时间考验的见识，这些见识过去是正确的，现在也仍然正确的。&#8230;&#8230;如果你在这本书中看不到一些你自己，你就不是一名计算机专业人员。买一本，读读它，然后把它留在你的经理的椅子上。相信你们俩都将受益匪浅。"--B. Scott Andersen，Silver anniversary edition hits gold, Amazon.com (Feb 27, 2001) <br>&#8730; "Weinberg在银年纪念版的每一章结尾处都做了评注，这恪守了他在前言里的承诺：'我决不会去掩盖自己的错误--因为也许正是通过这些错误，我的读者才会获得更大的收获。'&#8230;&#8230;有时侯，老书是最好的，尤其是在对其做了修订、对当初的大胆预言和贤明建议做了评价。"--Johanna Rothman </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title1 height=20><strong>（The Psychology of Computer Programming : Silver Anniversary Edition）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title2 height=30>9月出版，敬请关注！&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ISBN: 7-302-07026-1</td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;在计算机界，还没有任何一本计算机方面的书，在初次出版之后，能够在长达25年的岁月中一直保持活力——而且这种活力到今天仍在继续。《程序开发心理学》是开创&#8220;以人为本&#8221;研究方法的先驱，它以其对程序员们在智力、技巧、团队和问题求解能力等方面独特的视角和敏锐的观察经受住了时间的考验。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><a href="http://www.china-pub.com/computers/common/info.asp?id=9917" target=_blank><img class=img height=150 src="http://www.weinbergcn.com/cover/leader.gif" width=100 border=0></a></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=400 border=0>
                            <tbody>
                                <tr>
                                    <td class=title onmouseover='isdiv("div1",1)' onmouseout='isdiv("div1",0)' height=20>成为技术领导者——解决问题的有机方法</td>
                                </tr>
                                <tr>
                                    <td>
                                    <div id=div1 style="VISIBILITY: hidden; POSITION: absolute">
                                    <table cellSpacing=1 cellPadding=5 width=600 bgColor=#000000 border=0>
                                        <tbody>
                                            <tr>
                                                <td style="LINE-HEIGHT: 18px" bgColor=#fbfde6>&#8730; "共24章的内容，逻辑清晰、引发思考，帮助你如何完成从技术人员到问题解决型领导者的转变&#8230;&#8230;一本实用的、实实在在的指南&#8230;&#8230;热情、友好、诙谐的语言，不时地穿插着一些奇闻轶事，非常适合阅读。"--Cause/Effect <br>&#8730; "本书可是看作是一本有关发展个人领导能力的指南，但是，本书的价值不只这些&#8230;&#8230;本书包含很多有关个人职业成长非常实用和颇有价值的观点&#8230;&#8230;是这位作者写的最好的一本书之一。"--Journal of Systems Management <br>&#8730; "《成为技术领导者》可以指导所有领导者并使几乎任何一个领域的领导者受到鼓舞。"--Data Processing Digest <br>&#8730; "温伯格在书中阐述了不同类型的领导行为，分析了那些阻止我们进行有效领导或排斥他人领导的不利因素，并提出了能让我们把事情做得更好的行为。所有这些内容都是通过他幽默和坦率的语言表达出来的&#8230;&#8230;总是那么引人入胜&#8230;&#8230;激发我们去思考如何使技术人员在工作中进行有效的合作&#8230;&#8230;温伯格不仅在引导大家如何成为一名领导者，他自己本身就是一名出色的领导者。"--IEEE Computer <br>&#8730; "无论你是在管理单机、网络、还是多用户系统，你都将会发现这是一本条理清晰和内容精练的好书。"--Computer Book Review </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title1 height=20><strong>（Becoming a Technical Leader: An Organic Problem-Solving Approach）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title2 height=30>9月出版，敬请关注！&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ISBN: 7-302-06889-5</td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;本书阐述了作为一名成功领导者所必须掌握的领导方法与技巧——创新、激励和组织。本书提出了一些方法，供读者分析自己在这三个方面的领导技巧，并提供了开发这些技巧所需的实践步骤。本书探讨的范畴不仅仅局限于技术层面，而且还拓展到了如何与他人更好地协作。作者在讲解基本原理的过程中所举的逸闻趣事、类比与比喻令人印象深刻，因此有助于读者领会其中精要。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><a href="http://www.china-pub.com/computers/common/info.asp?id=9920" target=_blank><img class=img height=150 src="http://www.weinbergcn.com/cover/st.gif" width=100 border=0></a></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=400 border=0>
                            <tbody>
                                <tr>
                                    <td class=title onmouseover='isdiv("div2",1)' onmouseout='isdiv("div2",0)' height=20>系统化思维导论（银年纪念版）</td>
                                </tr>
                                <tr>
                                    <td>
                                    <div id=div2 style="VISIBILITY: hidden; POSITION: absolute">
                                    <table cellSpacing=1 cellPadding=5 width=400 bgColor=#000000 border=0>
                                        <tbody>
                                            <tr>
                                                <td style="LINE-HEIGHT: 18px" bgColor=#fbfde6>&#8730; 有关《系统化思维导论》（银年纪念版）的赞誉 <br>&#8730; 整理中... </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title1 height=20><strong>（An Introduction to General System Thinking）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title2 height=30>9月出版，敬请关注！&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ISBN: ISBN: 7-302-06804-6</td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;25年以来，《系统化思维导论》在介绍系统理论方面被一致认为是一本创新性的著作，在计算机以及其他各个领域获得了普遍的应用。在世界各地，在课堂上和研讨班，本书开启心灵、磨砺思维的威力得到不断地证明。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><a href="http://www.china-pub.com/main/sale/renwu/2-Weinberg9921.htm" target=_blank><img class=img height=150 src="http://www.weinbergcn.com/cover/sd.jpg" width=100 border=0></a></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=400 border=0>
                            <tbody>
                                <tr>
                                    <td class=title onmouseover='isdiv("div3",1)' onmouseout='isdiv("div3",0)' height=20>系统设计的一般原理</td>
                                </tr>
                                <tr>
                                    <td>
                                    <div id=div3 style="VISIBILITY: hidden; POSITION: absolute">
                                    <table cellSpacing=1 cellPadding=5 width=400 bgColor=#000000 border=0>
                                        <tbody>
                                            <tr>
                                                <td style="LINE-HEIGHT: 18px" bgColor=#fbfde6>&#8730; 有关《系统设计的一般原理》的赞誉 <br>&#8730; 整理中... </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title1 height=20><strong>（General Principles of Systems Design）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title2 height=30>10月出版，敬请关注！</td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;本书一位计算机专家与一位人类学家思想的碰撞结晶，针对那些无法通过传统方法加以解决的系统问题，本书为我们介绍了分析与理解这类问题的新观点与方法。本书是一本一般性系统思想著作，对各个学科领域，具有很广泛的适应性，不仅仅是关于计算机系统，还包括各种系统——人类、自然、科技。它提供了许多关于诸如设计信息处理系统、培训程序、商业组织、停车场、或都市人日常工作的应用实例。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><a href="http://www.china-pub.com/computers/common/info.asp?id=9928" target=_blank><img class=img height=150 src="http://www.weinbergcn.com/cover/review.jpg" width=100 border=0></a></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=460 border=0>
                            <tbody>
                                <tr>
                                    <td class=title onmouseover='isdiv("div4",1)' onmouseout='isdiv("div4",0)' height=20>走查、审查与技术复审手册——对程序、项目和产品进行评估</td>
                                </tr>
                                <tr>
                                    <td>
                                    <div id=div4 style="VISIBILITY: hidden; POSITION: absolute">
                                    <table cellSpacing=1 cellPadding=5 width=400 bgColor=#000000 border=0>
                                        <tbody>
                                            <tr>
                                                <td style="LINE-HEIGHT: 18px" bgColor=#fbfde6>&#8730; 有关《走查、审查与技术复审手册》的赞誉 <br>&#8730; 整理中... </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title1 height=20><strong>（Handbook of Walkthroughs, Inspections, and Technical Reviews : Evaluating Programs, Projects, and Products）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title2 height=30>9月出版，敬请关注！ ISBN: 7-302-06987-5</td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;这本备受赞誉和推崇的佳作，可以让你学会如何将技术复核的方法应用于各种产品与软件的开发过程。本书详细地解释了开展走查（或者同级团体复审）、审查和技术复审的流程，同时还为每一种接受复审的材料（包括规格、设计和代码复审）配备了详实的检查表。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><a href="http://www.china-pub.com/computers/subject/huodong/Weinberg/light.html" target=_blank><img class=img height=150 src="http://www.weinbergcn.com/cover/light.jpg" width=100 border=0></a></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=400 border=0>
                            <tbody>
                                <tr>
                                    <td class=title onmouseover='isdiv("div5",1)' onmouseout='isdiv("div5",0)' height=20>你的灯亮着吗？——发现问题的真正所在</td>
                                </tr>
                                <tr>
                                    <td>
                                    <div id=div5 style="VISIBILITY: hidden; POSITION: absolute">
                                    <table cellSpacing=1 cellPadding=5 width=600 bgColor=#000000 border=0>
                                        <tbody>
                                            <tr>
                                                <td style="LINE-HEIGHT: 18px" bgColor=#fbfde6>&#8730; "一本有关如何解决问题的最好的一本书。&#8230;&#8230;我强烈推荐这本书。"--John S. Rhodes, WebWord.com <br>&#8730; "出自Weinberg和Gause之手笔的又一本神奇的力作。"--Barry Kornfeld, Sound Bytes <br>&#8730; "作者用通俗易懂的故事，提出了他对问题定义的深刻见解以及实用的解决问题的方法，这些见解和方法对管理者的作用之大无法估量。尽管这一话题是非常严肃的，但是行文却幽默风趣，完全不是一本讨论技术的书。"--Jim Van Speybroeck, Data Processing Digest <br>&#8730; "这是迄今为止这一领域最有趣、最有帮助的一本书。作者在分析和处理问题的方法方面提出了很多颇有帮助和价值的建议。"--Charles Ashbacher, Amazon.com <br>&#8730; "我管理着一个程序员团队。我希望他们头脑反映敏捷，能够知道通向程序开发的捷径，把握住程序开发真正问题之所在，然后顺利解决这些问题。这就是为什么我给公司里的每一名程序员买了这本书。"--Garry Bor, 来自新加坡的一名软件工程师 <br>&#8730; "如果说这是一册教科书，那一定是我太偏爱了故事；如果说这是一束小品文，那一定是我太沉迷于思考；如果说这是程序员解决问题的指南，那一定是我忽略了问题的普遍性；如果说这将改变你的生活，那一定是你洞察了其中的奥秘。"--Citizen <br>&#8730; "本书包含很多具有深刻哲理的警句，诸如'不管看上去如何，人们很少知道他们想要什么，直到你给了他们想要的东西。'；'鱼总是最后一个看到水的。'但是本书并不是简单的警句的罗列，它真的是一本有关问题解决的有趣的和有用的书。&#8230;&#8230;我已经读了两遍，我还会很快再读一遍。"--Tim Ottinger, Object Mentor Inc. </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title1 height=20><strong>（Are Your Lights On? : How to Figure Out What the Problem Really Is）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title2 height=30>9月出版，敬请关注！ ISBN: 7-302-06888-7</td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;这是一本关于问题解决的书，在美国20年畅销不衰。主要探讨了从&#8220;问题出现&#8221;到&#8220;决定采用什么方式解决该问题&#8221;之间我们需要考虑的方方面面，从而教会你一种分析问题的全新思路，让你轻轻松松解决问题！20则幽默的现代寓言故事，60副精美的全彩卡通插图，您将看到大师温伯格如何改变我们的思考方式！ </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><img class=img height=150 src="http://www.weinbergcn.com/cover/blank.jpg" width=100 border=0></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title height=20>探索需求</td>
                                </tr>
                                <tr>
                                    <td class=title1 height=20><strong>（Exploring Requirement）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title2 height=30>2004年4月出版。UMLChina隆重推荐！</td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;本书着眼于系统设计之前的需求分析。通过对一些需求分析中的常见误区和问题的分析和讨论，从和客户沟通开始，深入研究一些可能的需求，澄清用户和开发者期望值，最终给出了能够大幅度提高项目成功几率的一些建议方法。全书语言通畅，词汇量小，通俗易懂，层次分明，是需求分析人员的入门和提高指南。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><img class=img height=150 src="http://www.weinbergcn.com/cover/blank.jpg" width=100 border=0></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title height=20>理解专业程序员</td>
                                </tr>
                                <tr>
                                    <td class=title1 height=20><strong>（Understanding the Professional Programmer）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title2 height=30>2004年年初出版，敬请关注！</td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;本书是一本关于人和思想方面的书。主要介绍了对于程序员这个职业来说什么问题是重要的，怎样在官僚机构中保持生存，成为职业程序员的方法，怎么样有效的思考，以及程序员这个职业的前途。本书的特点是各个短文简练易读，文中借用故事或轶事来阐明作者的观点，非常具有启发性。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><img class=img height=150 src="http://www.weinbergcn.com/cover/blank.jpg" width=100 border=0></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title2 height=30>12月出版，敬请关注！</td>
                                </tr>
                                <tr>
                                    <td class=title height=20>咨询的奥秘——成功提出和获得建议的指南</td>
                                </tr>
                                <tr>
                                    <td class=title1 height=20><strong>（Secrets of Consulting: A Guide to Giving and Getting Advice Successfully）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;本书内容是关于如何更好的为别人给出建议或接受别人建议的。作者凭借对自己25年专业经验总结和提炼，精辟地归纳出了各种规则、定律和原理，包括如何在竞争激烈的咨询市场中脱颖而出，如何为咨询服务定价和拓展市场，如何衡量咨询服务的有效性以及如何处理咨询人员与客户的关系等等。本书深受咨询专业人士推崇和欢迎，是一本畅销多年的经典著作。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><img class=img height=150 src="http://www.weinbergcn.com/cover/blank.jpg" width=100 border=0></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title height=20>咨询的奥秘——咨询师的百宝箱</td>
                                </tr>
                                <tr>
                                    <td class=title1 height=20><strong>（More Secrets of Consulting: The Consultant's Tool Kit）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;本书是Gerald M. Weinberg的畅销书The Secrets of Consulting的姊妹篇，在前一本书给出的众多定律、法则的基础上，本书给出了作为咨询人员应该具有的更多的专业和个人素质。作者通过生动的比喻，结合实例的简单精辟的说理，列举了咨询人员应该注重培养的能力，方法和生活态度。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><img class=img height=150 src="http://www.weinbergcn.com/cover/blank.jpg" width=100 border=0></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title2 height=30>2004年年初出版，敬请关注！</td>
                                </tr>
                                <tr>
                                    <td class=title height=20>质量软件管理——系统思维</td>
                                </tr>
                                <tr>
                                    <td class=title1 height=20><strong>（Quality Software Management : Systems Thinking）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;在本卷中，Gerald M. Weinberg剖析了开发质量软件的第一个必要条件：掌握（对问题、解答以及质量本身的）正确的思维方法。其中所介绍的在管理过程中应该遵循的方针，可以促使我们进行这类必要的思考。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><img class=img height=150 src="http://www.weinbergcn.com/cover/blank.jpg" width=100 border=0></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title height=20>质量软件管理——测试优先</td>
                                </tr>
                                <tr>
                                    <td class=title1 height=20><strong>（Quality Software Management : First-Order Measurement）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;该卷循序渐进地为你提供计划指导，使你学会通过细致的观察与测量来收集可靠的信息。详细介绍了具体的技术方法，同时还提供了一个模型，将复杂的测量过程划分为四个步骤：入口、含义、重要性和反馈。每一步都说明了在软件开发过程中，应该如何更为精确地进行观察与测量。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><img class=img height=150 src="http://www.weinbergcn.com/cover/blank.jpg" width=100 border=0></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title height=20>质量软件管理——协调行动</td>
                                </tr>
                                <tr>
                                    <td class=title1 height=20><strong>（Quality Software Management : Congruent Action）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;为了生产出高质量的软件，我们首先需要高质量的、得力的经理。Weinberg深受推崇的该系列丛书中独立的第三卷所讨论的，就是如何成长为这样一名经理。为了领导得力，经理们必须行动一致。换而言之，这些经理不仅需要对优秀软件工作的概念有所理解，而且还必须身体力行这些原理，在实践中这一点更为重要。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!---------------------->
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td vAlign=top width=168><img class=img height=150 src="http://www.weinbergcn.com/cover/blank.jpg" width=100 border=0></td>
                        <td vAlign=top width=463>
                        <table cellSpacing=0 cellPadding=0 width=463 border=0>
                            <tbody>
                                <tr>
                                    <td class=title height=20>质量软件管理——预期变革</td>
                                </tr>
                                <tr>
                                    <td class=title1 height=20><strong>（Quality Software Management : Anticipating Change）</strong></td>
                                </tr>
                                <tr>
                                    <td class=title3>&nbsp;&nbsp;&nbsp;&nbsp;软件企业进行变革的尝试往往以失败告终，其原因就在于对变革过程中的各种动力理解不够充分--这也是企业之所以出现危机的首当其冲的一个原因。Jerry Weinberg的这本书为其包含四本独立分卷的系列丛书进行了总结，该卷为我们在变革过程中的管理工作提供了注重实效、内容翔实的最后交待。 </td>
                                </tr>
                            </tbody>
                        </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td height=10></td>
                    </tr>
                    <tr>
                        <td background=images/book605.gif height=1></td>
                    </tr>
                    <tr>
                        <td height=10></td>
                    </tr>
                </tbody>
            </table>
            <!------------------>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td width=35 height=25><img height=26 src="http://www.weinbergcn.com/images/book606.gif" width=30 border=0></td>
                        <td class=title4 width=359 background=images/book504.gif>相关链接</td>
                        <td width=237><br></td>
                    </tr>
                </tbody>
            </table>
            <table cellSpacing=0 cellPadding=0 width=631 border=0>
                <tbody>
                    <tr>
                        <td class=setline vAlign=top align=right width=30 height=18>&#183;</td>
                        <td width=601><a href="http://www.weinbergcn.com/touming.html" target=_blank><font color=#000000>透明对温伯格的专访（《程序员》第9期）</font></a>&nbsp;<font color=#ff0000>NEW!</font></td>
                    </tr>
                    <tr>
                        <td class=setline align=right height=18>&#183;</td>
                        <td><a href="http://www.weinbergcn.com/mingrentang.html"><font color=#000000>名人堂温伯格专栏（《程序员》第8期）</font></a>&nbsp;<font color=#ff0000>NEW!</font></td>
                    </tr>
                    <tr>
                        <td class=setline align=right height=18>&#183;</td>
                        <td><a href="http://www.weinbergcn.com/preface_zyq.html"><font color=#000000>微软亚洲研究院院长兼首席科学家张亚勤专文推荐</font></a></td>
                    </tr>
                    <tr>
                        <td class=setline align=right height=18>&#183;</td>
                        <td><a href="http://www.weinbergcn.com/jianqi.html"><font color=#000000>剑、气和令狐冲</font></a></td>
                    </tr>
                    <tr>
                        <td class=setline align=right height=18>&#183;</td>
                        <td><a href="http://www.weinbergcn.com/loutai.html"><font color=#000000>七宝楼台今安在</font></a></td>
                    </tr>
                    <tr>
                        <td class=setline align=right height=18>&#183;</td>
                        <td><a href="http://www.weinbergcn.com/guoxing.html"><font color=#000000>个体性最后的堡垒</font></a></td>
                    </tr>
                    <tr>
                        <td class=setline align=right height=18>&#183;</td>
                        <td><a href="http://www.weinbergcn.com/wutuobang.html"><font color=#000000>走出问题的乌托邦</font></a></td>
                    </tr>
                    <tr>
                        <td class=setline align=right height=18>&#183;</td>
                        <td><a href="http://www.weinbergcn.com/shangdi.html"><font color=#000000>从今天开始，做你自己的上帝</font></a></td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
<!---------------->
<table cellSpacing=0 cellPadding=0 width=770 background=images/book404.gif border=0>
    <tbody>
        <tr>
            <td vAlign=top width=90 height=74><img height=64 src="http://www.weinbergcn.com/images/book405.gif" width=79 border=0></td>
            <td vAlign=top width=680>
            <table cellSpacing=0 cellPadding=0 border=0>
                <tbody>
                    <tr>
                        <td height=32></td>
                    </tr>
                    <tr>
                        <td class=setwhite>Copyright by shinebook, who publishes best books for IT people.<br>Edited by Shiningxyy,and designed by Orrin.</td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
</center>
<img src ="http://www.cppblog.com/ztwaker/aggbug/53698.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-06-17 14:08 <a href="http://www.cppblog.com/ztwaker/archive/2008/06/17/53698.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Project management</title><link>http://www.cppblog.com/ztwaker/archive/2008/06/13/53110.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Fri, 13 Jun 2008 03:23:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/06/13/53110.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/53110.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/06/13/53110.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/53110.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/53110.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Project managementFrom Wikipedia, the free encyclopediaJump to: navigation, searchProject Management is the discipline of planning, organizing, and managing resources to bring about the su...&nbsp;&nbsp;<a href='http://www.cppblog.com/ztwaker/archive/2008/06/13/53110.html'>阅读全文</a><img src ="http://www.cppblog.com/ztwaker/aggbug/53110.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-06-13 11:23 <a href="http://www.cppblog.com/ztwaker/archive/2008/06/13/53110.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Macadamian's Code Review Checklist</title><link>http://www.cppblog.com/ztwaker/archive/2008/06/10/52752.html</link><dc:creator>子弹</dc:creator><author>子弹</author><pubDate>Tue, 10 Jun 2008 06:38:00 GMT</pubDate><guid>http://www.cppblog.com/ztwaker/archive/2008/06/10/52752.html</guid><wfw:comment>http://www.cppblog.com/ztwaker/comments/52752.html</wfw:comment><comments>http://www.cppblog.com/ztwaker/archive/2008/06/10/52752.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/ztwaker/comments/commentRss/52752.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/ztwaker/services/trackbacks/52752.html</trackback:ping><description><![CDATA[<h1><a style="FONT-SIZE: 8pt; FONT-FAMILY: courier new" href="http://www.macadamian.com/index.php?option=com_content&amp;task=view&amp;id=27&amp;Itemid=31">From: http://www.macadamian.com/index.php?option=com_content&amp;task=view&amp;id=27&amp;Itemid=31</a></h1>
<h1>Macadamian's Code Review Checklist&nbsp;</h1>
<p class=MsoBodyText2>At Macadamian, we practice what we preach with peer code reviews. Before we commit any code to source control, we check it for compliance with this list.</p>
<p>We&#8217;ve made the checklist public for the use of software development teams implementing code review as part of their process. For more information about code review processes and software development best practices, read check out the Critical Path newsletter &#8211; it&#8217;s free, too!</p>
<p><a href="http://www.macadamian.com/codereview.htm#GeneralCodeSmokeTest"><font color=#406d87><u>General Code Smoke Test</u></font></a><br><a href="http://www.macadamian.com/index.php?option=com_content&amp;task=view&amp;id=27&amp;Itemid=31#CommentsandCodingConventions"><font color=#406d87><u>Comments and Coding Conventions</u></font></a><br><a href="http://www.macadamian.com/index.php?option=com_content&amp;task=view&amp;id=27&amp;Itemid=31#ErrorHandling"><font color=#406d87><u>Error Handling</u></font></a><br><a href="http://www.macadamian.com/index.php?option=com_content&amp;task=view&amp;id=27&amp;Itemid=31#ResourceLeaks"><font color=#406d87><u>Resource Leaks</u></font></a><br><a href="http://www.macadamian.com/index.php?option=com_content&amp;task=view&amp;id=27&amp;Itemid=31#ControlStructures"><font color=#406d87><u>Control Structures</u></font></a><br><a href="http://www.macadamian.com/index.php?option=com_content&amp;task=view&amp;id=27&amp;Itemid=31#Performance"><font color=#406d87><u>Performance</u></font></a><br><a href="http://www.macadamian.com/index.php?option=com_content&amp;task=view&amp;id=27&amp;Itemid=31#Functions"><font color=#406d87><u>Functions</u></font></a><br><a href="http://www.macadamian.com/index.php?option=com_content&amp;task=view&amp;id=27&amp;Itemid=31#BugFixes"><font color=#406d87><u>Bug Fixes</u></font></a><br><a href="http://www.macadamian.com/index.php?option=com_content&amp;task=view&amp;id=27&amp;Itemid=31#Math"><u><font color=#406d87>Math</font></u></a> </p>
<br>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size=2><a name=GeneralCodeSmokeTest><br></a></font>&nbsp;</p>
<h3><a name=GeneralCodeSmokeTest>General Code Smoke Test</a></h3>
<p><font color=#555555><strong>Does the code build correctly?</strong><br></font><em>No errors should occur when building the source code. No warnings should be introduced by changes made to the code.</em></p>
<p><font color=#555555><strong>Does the code execute as expected?</strong><br></font><em>When executed, the code does what it is supposed to.</em></p>
<p><font color=#555555><strong>Do you understand the code you are reviewing?</strong><br></font><em>As a reviewer, you should understand the code. If you don't, the review may not be complete, or the code may not be well commented.</em></p>
<p><font color=#555555><strong>Has the developer tested the code?</strong><br></font><em>Insure the developer has unit tested the code before sending it for review. All the limit cases should have been tested.</em></p>
<h3><a name=CommentsandCodingConventions>Comments and Coding Conventions</a></h3>
<p><font color=#555555><strong>Does the code respect the project coding conventions?</strong><br></font><em>Check that the coding conventions have been followed. Variable naming, indentation, and bracket style should be used. </em></p>
<p><font color=#555555><strong>Does the source file start with an appropriate header and copyright information?</strong><br></font><em>Each source file should start with an appropriate header and copyright information. All source files should have a comment block describing the functionality provided by the file.</em> </p>
<p><font color=#555555><strong>Are variable declarations properly commented?</strong><br></font><em>Comments are required for aspects of variables that the name doesn't describe. Each global variable should indicate its purpose and why it needs to be global.</em></p>
<p><font color=#555555><strong>Are units of numeric data clearly stated?</strong><br></font><em>Comment the units of numeric data. For example, if a number represents length, indicate if it is in feet or meters.</em></p>
<p><font color=#555555><strong>Are all functions, methods and classes documented?</strong><br></font><em>Describe each routine, method, and class in one or two sentences at the top of its definition. If you can't describe it in a short sentence or two, you may need to reassess its purpose. It might be a sign that the design needs to be improved.</em></p>
<p><font color=#555555><strong>Are function parameters used for input or output clearly identified as such?</strong><br></font><em>Make it clear which parameters are used for input and output.</em></p>
<p><font color=#555555><strong>Are complex algorithms and code optimizations adequately commented?</strong><br></font><em>Complex areas, algorithms, and code optimizations should be sufficiently commented, so other developers can understand the code and walk through it.</em></p>
<p><font color=#555555><strong>Does code that has been commented out have an explanation?</strong><br></font><em>There should be an explanation for any code that is commented out. "Dead Code" should be removed. If it is a temporary hack, it should be identified as such.</em></p>
<p><font color=#555555><strong>Are comments used to identify missing functionality or unresolved issues in the code?</strong><br></font><em>A comment is required for all code not completely implemented. The comment should describe what's left to do or is missing. You should also use a distinctive marker that you can search for later (For example: "TODO:francis").</em> </p>
<h3><a name=ErrorHandling>Error Handling</a></h3>
<p><font color=#555555><strong>Are assertions used everywhere data is expected to have a valid value or range?</strong><br></font><em>Assertions make it easier to identify potential problems. For example, test if pointers or references are valid.</em></p>
<p><font color=#555555><strong>Are errors properly handled each time a function returns?</strong><br></font><em>An error should be detected and handled if it affects the execution of the rest of a routine. For example, if a resource allocation fails, this affects the rest of the routine if it uses that resource. This should be detected and proper action taken. In some cases, the "proper action" may simply be to log the error.</em></p>
<p><font color=#555555><strong>Are resources and memory released in all error paths?</strong><br></font><em>Make sure all resources and memory allocated are released in the error paths.</em></p>
<p><font color=#555555><strong>Are all thrown exceptions handled properly?</strong><br></font><em>If the source code uses a routine that throws an exception, there should be a function in the call stack that catches it and handles it properly.</em></p>
<p><font color=#555555><strong>Is the function caller notified when an error is detected?</strong><br></font><em>Consider notifying your caller when an error is detected. If the error might affect your caller, the caller should be notified. For example, the "Open" methods of a file class should return error conditions. Even if the class stays in a valid state and other calls to the class will be handled properly, the caller might be interested in doing some error handling of its own.</em></p>
<p><font color=#555555><strong>Has error handling code been tested?</strong><br></font><em>Don't forget that error handling code that can be defective. It is important to write test cases that exercise it.</em></p>
<h3><a name=ResourceLeaks>Resource Leaks</a></h3>
<p><font color=#555555><strong>Is allocated memory (non-garbage collected) freed?</strong><br></font><em>All allocated memory needs to be freed when no longer needed. Make sure memory is released in all code paths, especially in error code paths.</em></p>
<p><font color=#555555><strong>Are all objects (Database connections, Sockets, Files, etc.) freed even when an error occurs?</strong><br></font><em>File, Sockets, Database connections, etc. (basically all objects where a creation and a deletion method exist) should be freed even when an error occurs. For example, whenever you use "new" in C++, there should be a delete somewhere that disposes of the object. Resources that are opened must be closed. For example, when opening a file in most development environments, you need to call a method to close the file when you're done.</em></p>
<p><font color=#555555><strong>Is the same object released more than once?</strong><br></font><em>Make sure there's no code path where the same object is released more than once. Check error code paths.</em></p>
<p><font color=#555555><strong>Does the code accurately keep track of reference counting?</strong><br></font><em>Frequently a reference counter is used to keep the reference count on objects (For example, COM objects). The object uses the reference counter to determine when to destroy itself. In most cases, the developer uses methods to increment or decrement the reference count. Make sure the reference count reflects the number of times an object is referred.</em></p>
<h3><a name=ThreadSafeness>Thread Safeness</a></h3>
<p><font color=#555555><strong>Are all global variables thread-safe?</strong><br></font><em>If global variables can be accessed by more than one thread, code altering the global variable should be enclosed using a synchronization mechanism such as a mutex. Code accessing the variable should be enclosed with the same mechanism.</em></p>
<p><font color=#555555><strong>Are objects accessed by multiple threads thread-safe?</strong><br></font><em>If some objects can be accessed by more than one thread, make sure member variables are protected by synchronization mechanisms.</em></p>
<p><font color=#555555><strong>Are locks released in the same order they are obtained?</strong><br></font><em>It is important to release the locks in the same order they were acquired to avoid deadlock situations. Check error code paths.</em></p>
<p><font color=#555555><strong>Is there any possible deadlock or lock contention?</strong><br></font><em>Make sure there's no possibility for acquiring a set of locks (mutex, semaphores, etc.) in different orders. For example, if Thread A acquires Lock #1 and then Lock #2, then Thread B shouldn't acquire Lock #2 and then Lock #1.</em></p>
<h3><a name=ControlStructures>Control Structures</a></h3>
<p><font color=#555555><strong>Are loop ending conditions accurate?</strong><br></font><em>Check all loops to make sure they iterate the right number of times. Check the condition that ends the loop; insure it will end out doing the expected number of iterations.</em></p>
<p><font color=#555555><strong>Is the code free of unintended infinite loops?</strong><br></font><em>Check for code paths that can cause infinite loops. Make sure end loop conditions will be met unless otherwise documented.</em></p>
<h3><a name=Performance>Performance</a></h3>
<p><font color=#555555><strong>Do recursive functions run within a reasonable amount of stack space?</strong><br></font><em>Recursive functions should run with a reasonable amount of stack space. Generally, it is better to code iterative functions.</em></p>
<p><font color=#555555><strong>Are whole objects duplicated when only references are needed?</strong><br></font><em>This happens when objects are passed by value when only references are required. This also applies to algorithms that copy a lot of memory. Consider using algorithm that minimizes the number of object duplications, reducing the data that needs to be transferred in memory.</em></p>
<p><font color=#555555><strong>Does the code have an impact on size, speed, or memory use?</strong><br></font><em>Can it be optimized? For instance, if you use data structures with a large number of occurrences, you might want to reduce the size of the structure.</em></p>
<p><font color=#555555><strong>Are you using blocking system calls when performance is involved?</strong><br></font><em>Consider using a different thread for code making a function call that blocks.</em></p>
<p><font color=#555555><strong>Is the code doing busy waits instead of using synchronization mechanisms or timer events?</strong><br></font><em>Doing busy waits takes up CPU time. It is a better practice to use synchronization mechanisms.</em></p>
<p><font color=#555555><strong>Was this optimization really needed?</strong><br></font><em>Optimizations often make code harder to read and more likely to contain bugs. Such optimizations should be avoided unless a need has been identified. Has the code been profiled?</em></p>
<h3><a name=Functions>Functions</a></h3>
<p><font color=#555555><strong>Are function parameters explicitly verified in the code?</strong><br></font><em>This check is encouraged for functions where you don't control the whole range of values that are sent to the function. This isn't the case for helper functions, for instance. Each function should check its parameter for minimum and maximum possible values. Each pointer or reference should be checked to see if it is null. An error or an exception should occur if a parameter is invalid.</em></p>
<p><font color=#555555><strong>Are arrays explicitly checked for out-of-bound indexes?</strong><br></font><em>Make sure an error message is displayed if an index is out-of-bound.</em></p>
<p><font color=#555555><strong>Are functions returning references to objects declared on the stack?</strong><br></font><em>Don't return references to objects declared on the stack, return references to objects created on the heap.</em></p>
<p><font color=#555555><strong>Are variables initialized before they are used?</strong><br></font><em>Make sure there are no code paths where variables are used prior to being initialized. If an object is used by more than one thread, make sure the object is not in use by another thread when you destroy it. If an object is created by doing a function call, make sure the object was created before using it.</em></p>
<p><font color=#555555><strong>Does the code re-write functionality that could be achieved by using an existing API?</strong><br></font><em>Don't reinvent the wheel. New code should use existing functionality as much as possible. Don't rewrite source code that already exists in the project. Code that is replicated in more than one function should be put in a helper function for easier maintenance.</em></p>
<h3><a name=BugFixes>Bug Fixes</a></h3>
<p><font color=#555555><strong>Does a fix made to a function change the behavior of caller functions?</strong><br></font><em>Sometimes code expects a function to behave incorrectly. Fixing the function can, in some cases, break the caller. If this happens, either fix the code that depends on the function, or add a comment explaining why the code can't be changed.</em></p>
<p><font color=#555555><strong>Does the bug fix correct all the occurrences of the bug?</strong><br></font><em>If the code you're reviewing is fixing a bug, make sure it fixes all the occurrences of the bug.</em></p>
<h3><a name=Math>Math</a></h3>
<p><font color=#555555><strong>Is the code doing signed/unsigned conversions?</strong><br></font><em>Check all signed to unsigned conversions: Can sign completion cause problems? Check all unsigned to signed conversions: Can overflow occur? Test with Minimum and Maximum possible values.</em> </p>
<img src ="http://www.cppblog.com/ztwaker/aggbug/52752.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/ztwaker/" target="_blank">子弹</a> 2008-06-10 14:38 <a href="http://www.cppblog.com/ztwaker/archive/2008/06/10/52752.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>