99 Bottles of OOP: A Practical Guide to Object-Oriented Design. 2 Ed

Оглавление⌄
ColophonYour Rights As A ReaderDedicationPrefaceWhat This Book Is AboutWho Should Read This BookBefore You Read This BookHow To Read This BookCode ExamplesErrataAbout the AuthorsAbout the TranslatorsIntroduction1. Rediscovering Simplicity1.1. Simplifying Code1.1.1. Incomprehensibly Concise1.1.2. Speculatively General1.1.3. Concretely Abstract1.1.4. Shameless Green1.2. Judging Code1.2.1. Evaluating Code Based on Opinion1.2.2. Evaluating Code Based on Facts1.2.3. Comparing Solutions1.3. Summary2. Test Driving Shameless Green2.1. Understanding Testing2.2. Writing the First Test2.3. Removing Duplication2.4. Tolerating Duplication2.5. Hewing to the Plan2.6. Exposing Responsibilities2.7. Choosing Names2.8. Revealing Intentions2.9. Writing Cost-Effective Tests2.10. Avoiding the Echo-Chamber2.11. Considering Options2.12. Summary3. Unearthing Concepts3.1. Listening to Change3.2. Starting With the Open/Closed Principle3.3. Recognizing Code Smells3.4. Identifying the Best Point of Attack3.5. Refactoring Systematically3.6. Following the Flocking Rules3.7. Converging on Abstractions3.7.1. Focusing on Difference3.7.2. Simplifying Hard Problems3.7.3. Naming Concepts3.7.4. Making Methodical Transformations3.7.5. Refactoring Gradually3.8. Summary4. Practicing Horizontal Refactoring4.1. Replacing Difference With Sameness4.2. Equivocating About Names4.3. Deriving Names From Responsibilities4.4. Choosing Meaningful Defaults4.5. Seeking Stable Landing Points4.6. Obeying the Liskov Substitution Principle4.7. Taking Bigger Steps4.8. Discovering Deeper Abstractions4.9. Depending on Abstractions4.10. Summary5. Separating Responsibilities5.1. Selecting the Target Code Smell5.1.1. Identifying Patterns in Code5.1.2. Spotting Common Qualities5.1.3. Enumerating Flocked Method Commonalities5.1.4. Insisting Upon Messages5.2. Extracting Classes5.2.1. Modeling Abstractions5.2.2. Naming Classes5.2.3. Extracting BottleNumber5.2.4. Removing Arguments5.2.5. Trusting the Process5.3. Appreciating Immutability5.4. Assuming Fast Enough5.5. Creating BottleNumbers5.6. Recognizing Liskov Violations5.7. Summary6. Achieving Openness6.1. Consolidating Data Clumps6.2. Making Sense of Conditionals6.3. Replacing Conditionals with Polymorphism6.3.1. Dismembering Conditionals6.3.2. Manufacturing Objects6.3.3. Prevailing with Polymorphism6.4. Transitioning Between Types6.5. Making the Easy Change6.6. Defending the Domain6.7. Summary7. Manufacturing Intelligence7.1. Contrasting the Concrete Factory with Shameless Green7.2. Fathoming Factories7.3. Opening the Factory7.4. Supporting Arbitrary Class Names7.5. Dispersing The Choosing Logic7.6. Self-registering Candidates7.7. Auto-registering Candidates7.8. Summary8. Developing a Programming Aesthetic8.1. Appreciating the Mechanical Process8.2. Clarifying Responsibilities with Pseudocode8.3. Extracting the Verse8.4. Coding by Wishful Thinking8.5. Inverting Dependencies8.5.1. Injecting Dependencies8.5.2. Isolating Variants8.5.3. Grappling with Inversion8.6. Obeying the Law of Demeter8.6.1. Understanding the Law8.6.2. Curing Demeter Violations8.7. Identifying What The Verse Method Wants8.8. Pushing Object Creation to the Edge8.9. Summary9. Reaping the Benefits of Design9.1. Choosing Which Units to Test9.1.1. Contrasting Unit and Integration Tests9.1.2. Foregoing Tests9.2. Reorganizing Tests9.2.1. Gathering BottleVerse Tests9.2.2. Revealing Intent9.3. Seeking Context Independence9.3.1. Examining Bottles' Responsibilities9.3.2. Purifying Tests With Fakes9.3.3. Purging Redundant Tests9.3.4. Profiting from Loose Coupling9.4. Communicating With the Future9.4.1. Enriching Code with Signals9.4.2. Verifying Roles9.4.3. Obliterating Obsolete Context9.5. SummaryAfterwordAppendix A: Initial ExerciseGetting the exerciseDoing the exerciseTest SuiteReferencesAcknowledgements
Описание
В этом материале разберём тему: chapter.
It introduces a type of solution known asShameless Green, and argues that although Shameless Green is neither clever nor changeable, it is the best initial solution to many problems.Chapter 2 is a primer for Test-Driven Development (TDD), which is used to find Shameless Green. This book is about writing cost-effective, maintainable, and pleasing code.Chapter 1 explores how to decide if code is "good enough." This chapter uses metrics to compare several possible solutions to the 99 Bottles problem. This chapter is concerned with deciding what to test, and with creating tests that happily tolerate changes to the underlying code.Chapter 3 introduces a new requirement (six-pack), which leads to a discussion of how to decide where to start when changing code. The chapter then defines a simple set of Flocking Rules, which guide a step-by-step refactoring of code.Chapter 4 continues the step-by-step refactoring begun in Chapter 3. This chapter examines the Open/Closed Principle, and thenexplores code smells. It iteratively applies the Flocking Rules, eventually stumbles across the need for the Liskov Substitution Principle, and ultimately unearths a deeply hidden abstraction.Chapter 5 inventories the existing code for smells, chooses the most prominent one, and uses it to trigger the creation of a new class. It begins by exploring a simple, hard-coded conditional, and ends with a factory whose candidate objects both self-register, and also supply the logic needed to choose them.Chapter 8 introduces another new requirement—to vary the lyrics. Along the way, it takes a hard look at immutability, performance, and caching.Chapter 6 performs a miracle that not only removes the conditionals, but also allows you to finally implement the new six-pack requirement without altering existing code.Chapter 7 examines the tradeoffs along a continuum of six different styles of Factories. It uses this requirement to introduce the idea of a programming aesthetic, or set of rules to guide you in times of uncertainty. It takes advantage of the improved The chapter ends with a list of specific suggestions for deciding when it’s worthwhile to voluntarily improve code.Chapter 9 comes full circle and returns to testing.
Файл доступен для загрузки ниже.
Поделиться
Частые вопросы
Можно ли скачать «99 Bottles of OOP: A Practical Guide to Object-Oriented Design. 2 Ed» бесплатно?
Да, «99 Bottles of OOP: A Practical Guide to Object-Oriented Design. 2 Ed» доступна для бесплатного скачивания на нашем сайте в формате PDF. Ссылка на файл находится на этой странице.
В каком формате и какого размера файл?
Книга предоставляется в формате PDF, размер файла 2,1 МБ.
Кто автор и когда вышла книга?
автор — Metz Sandi, издательство Potato Canyon Software, LLC., год выпуска 2021, 298 страниц.
О чём книга «99 Bottles of OOP: A Practical Guide to Object-Oriented Design. 2 Ed»?
This book is about writing cost-effective, maintainable, and pleasing code.Chapter 1 explores how to decide if code is "good enough." This chapter uses metrics to compare several possible solutions to the 99 Bottles problem.