Functional Design: Principles, Patterns, and Practices

Оглавление⌄
Foreword xiiiPreface xvAcknowledgments xxiAbout the Author xxiiiPART I Functional Basics....1Chapter 1 Immutability....3What Is Functional Programming?....4The Problem with Assignment....7So Why Is It Called Functional?....10No Change of State?....12Immutability....15Chapter 2 Persistent Data....17On Cheating....19Making Copies....20Structural Sharing....23ContentsChapter 3 Recursion and Iteration....27Iteration....28Very Brief Clojure Tutorial....29Iteration....32TCO, Clojure, and the JVM....32Recursion....32Chapter 4 Laziness....37Lazy Accumulation....40OK, but Why?....41Coda....42Chapter 5 Statefulness....43When We MUST Mutate....47Software Transactional Memory (STM)....48Life Is Hard, Software Is Harder....51PART II Comparative Analysis....53Chapter 6 Prime Factors....55Java Version....56Clojure Version....60Conclusion....63Chapter 7 Bowling Game....65Java Version....66Clojure Version....71Conclusion....75Chapter 8 Gossiping Bus Drivers....77Java Solution....78Driver....84Route....85Stop....85Rumor....86Simulation....87Clojure....88Conclusion....93Chapter 9 Object-Oriented Programming....95Functional Payroll....98Namespaces and Source Files....107Conclusion....108Chapter 10 Types....109PART III Functional Design....115Chapter 11 Data Flow....117Chapter 12 SOLID....125The Single Responsibility Principle (SRP)....126The Open-Closed Principle (OCP)....131Functions....133Objects with Vtables....134Multi-methods....135Independent Deployability....136The Liskov Substitution Principle (LSP)....138The ISA Rule....142Nope!....145The Representative Rule....146The Interface Segregation Principle (ISP)....147Don’t Depend on Things You Don’t Need....150Why?....151Conclusion....151The Dependency Inversion Principle (DIP)....152A Blast from the Past....155A DIP Violation....165Conclusion....179PART IV Functional Pragmatics....181Chapter 13 Tests....183But What about the REPL?....184What about Mocks?....184Property-Based Testing....186A Diagnostic Technique....190Functional....197Chapter 14 GUI....199Turtle-Graphics in Quil....200Chapter 15 Concurrency....215Conclusion....225PART V Design Patterns....227Chapter 16 Design Patterns Review....229Patterns in Functional Programming....233Abstract Server....233Adapter....236Is That Really an Adapter Object?....241Command....242Undo....245Composite....249Functional?....254Decorator....260Visitor....264To Close, or to Clojure?....267The 90-degree Problem....270Abstract Factory....27490 Degrees Again....279Type Safety?....281Conclusion....281Postscript: OO Poison?....282PART VI Case Study....285Chapter 17 Wa-Tor....287Scratch That Itch....309Showers Solve Problems....312It’s Time to Wildly Reproduce....322What about the Sharks?....324Conclusion....335Afterword....337Index....341
Описание
В этом материале разберём тему: functional.
Martin ("Uncle Bob") explains how and why to use functional programming to build better systems for real customers. In Functional Design, renowned software engineer Robert C. Martin compares conventional object-oriented coding structures in Java to those enabled by functional languages, identifies the best roles for each, and shows how to build better systems by judiciously using them in context.
Through accessible examples, working developers will discover how the easy-to-learn, semantically rich Clojure language can help them improve code cleanliness, design, discipline, and outcomes. Martin's approach is pragmatic, minimizing theory in favor of "in the-trenches" problem-solving. Martin examines well-known SOLID principles and Gang of Four Design Patterns from a functional perspective, revealing why patterns remain extremely valuable to functional programmers, and how to use them to achieve superior results.
Understand functional basics: immutability, persistent data, recursion, iteration, laziness, and statefulness
Contrast functional and object approaches through expertly crafted case studies
Explore functional design techniques for data flow
Use classic SOLID principles to write better Clojure code
Master pragmatic approaches to functional testing, GUIs, and concurrency
Make the most of design patterns in functional environments
Walk through building an enterprise-class Clojure application
На этом основные моменты по теме закрыты.
Поделиться
Частые вопросы
Можно ли скачать «Functional Design: Principles, Patterns, and Practices» бесплатно?
Да, «Functional Design: Principles, Patterns, and Practices» доступна для бесплатного скачивания на нашем сайте в формате PDF. Ссылка на файл находится на этой странице.
В каком формате и какого размера файл?
Книга предоставляется в формате PDF, размер файла 3,2 МБ.
Кто автор и когда вышла книга?
автор — Martin Robert Cecil, издательство Pearson Education Limited, год выпуска 2024, 376 страниц.
О чём книга «Functional Design: Principles, Patterns, and Practices»?
In Functional Design, renowned software engineer Robert C.