利用经验累积而得的洞察力开发新的解决方案被称为预构。透过重构而获得的专业知识也属于这类经验,而预构的词源即重构。重构是修改程序或软件系统内部结构的实践,以此在保留其现有行为的基础上改良设计。重构的原因有多种:方便后期增加功能、提高可维护性、提升性能。 \r\n 本书作者是经验老道的软件开发人员。书中,作者运用他个人和其他众多开发人员的丰富经验,展示由其推衍而得的各项实践方针。这些方针把优秀的开发人员在设计时隐而未显的考虑细节如实地呈现出来。许多方针都围绕着极致抽象化、极致隔离以及极致可读性这几个概念。在假想的软件项目和实际项目的介绍中,作者把实践方针呈现在读者面前。其中几条于稍后列出。 \r\n 把作者的方针应用到你的软件项目,有助于写出可读性、可维护性更棒的程序。这些方针可以协助你前期决策,以减少后期重构的工作量。在这样的前提下,你可以预测未来,减少修改。简言之,就是程序预构会使你更有效率。
PREFACE\r\n1 INTRODUCTION TO PREFACTORING\r\n What Is Prefactoring?\r\n The Three Extremes\r\n The Guidelines Explored\r\n The Context for This Book\r\n2 THE SYSTEM IN SO MANY WORDS\r\n Meet Sam\r\n Reinvention Avoidance\r\n What''s in a Name?\r\n Splitters Versus Lumpers\r\n Clumping\r\n Abstracting\r\n Prototypes Are Worth a Thousand Words\r\n3 GENERAL DEVELOPMENT ISSUES\r\n Start with the Big Picture\r\n Interface Contracts\r\n Validation\r\n Code Communicates\r\n Consistency Is Simplicity\r\n A Prefactoring Attitude\r\n Don''t Repeat Yourself\r\n Documentation of Assumptions and Decisions\r\n Dealing with Deuiations and Errors\r\n Speeding\r\n The Spreadsheet Conundrum\r\n Tools Are Tools--Use Them Wisely\r\n4 GETTING THE BIG PICTURE\r\n The Rest of the Story\r\n Process\r\n The Initial Design\r\n Global Planning, Local Designing\r\n Testing Functionality\r\n Testing quality\r\n Security\r\n5 GOT CLASS ?\r\n Categories and Classes\r\n Declaration Versus Execution\r\n Appropriate Inheritance\r\n Communicate withext\r\n More Than One\r\n6 A FEW WORDS ON CLASSES\r\n Honor the Class Maxims\r\n Three Laws of Objects\r\n Need Determines Class\r\n Polymorphism\r\n One Little.lob\r\n Policy Versus Implementation\r\n Extreme Naming\r\n Overloading Functions\r\n7 GETTING THERE\r\n Where We Are\r\n Separating Concerns\r\n Migrating to the New System\r\n8 THE FIRSTRELEASE\r\n The Proof Is in the Puddin.~\r\n Relrospective Time\r\n The System as It Stands Now\r\n Operations Interface\r\n Abstract Data Types\r\n Configuration\r\n Testing\r\n Dealing with Deuiations and Errors\r\n A Little Prefactofing\r\n The First Released Iteration\r\n Sometimes Practice Does Not Match Theory\r\n The Rest of the Classes\r\n9 ASSOCIATIONS AND STATES\r\n Sam''s Neuw Requirement\r\n Who''s in Charge?\r\n The State of an Object\r\n10 INTERFACES AND ADAPTATION\r\n The Catalog Search Use Case\r\n Designinn the Interface\r\n Interface Development\r\n Interface Testing\r\n Interface Splitting\r\n Something Worlking\r\n11 ZIP CODES AND INTERFACES\r\n Adaptation\r\n Pass the Buck\r\n Unwritten Code\r\n Indirection\r\n Logging\r\n Paradigm Mismatch\r\n12 MORE REPORTS\r\n Fancy Reports\r\n Change Happens\r\n Exports\r\n13 INVOICES, CREDIT CARDS, AND DISCOUNTS\r\n The Next Step\r\n The Language of the Client\r\n Security and Priuacy\r\n14 SAM IS EXPANDING\r\n The Second Store\r\n A New Development\r\n The Third Store\r\n Goodbye Sam\r\n Generality\r\n15 A PRINTSERVER EXAMPLE\r\n Introduction\r\n The System\r\n The Message\r\n Testing\r\n Logging\r\n Still More Separation\r\n Epilogue\r\n]6 ANTISPAM EXAMPLE\r\n The Context\r\n Spare Checking\r\n The ReceivingMailServer\r\n ReceivedMailExaminer\r\n The Full Flow\r\n17 EPILOGUE\r\nA GUIDELINES AND PRINCIPLES\r\nB SOURCE CODE\r\nINDEX
Ken Pugh是Puge-Killen协会主席之一。Ken担任顾问、从事教育培训、担任教师以及出庭提供证词,涉足的科技领域有面向对象设计、Linux/unix、网络以及系统开发实践。他参与过的项目包括山羊血清流程控制、担保抵押处理软件以及摄影分级。Ken时常在全国会议和区域会议发表演讲,从伦敦到悉尼都有他的客户。不工作时,他喜欢滑雪、冲浪、骑自行车以及到阿帕拉契山径徒步旅行。
无封面