
Functional Design
Principles, Patterns, and Practices
Robert Martin(Autor*in)
Addison Wesley (Verlag)
Erschienen am 15. Oktober 2023
384 Seiten
978-0-13-817648-8 (ISBN)
Systemvoraussetzungen
für ePUB mit Wasserzeichen-DRM
E-Book Einzellizenz
Bei dem Kauf dieses E-Books erwerben Sie eine Einzel-Lizenz für eine natürliche Person, die nicht übertragbar ist. [L]
Als Download verfügbar
Beschreibung
A Practical Guide to Better, Cleaner Code with Functional Programming
In Functional Design, renowned software engineer Robert C. Martin ("Uncle Bob") explains how and why to use functional programming to build better systems for real customers. 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.
Martin's approach is pragmatic, minimizing theory in favor of "in the-trenches" problem-solving. 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 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 exudes 'classic-on-arrival'. Bob pulls back the curtain to reveal how functional programming elements make software design simple yet pragmatic. He does so without alienating experienced object-oriented programmers coming from languages like C#, C++, or Java."
--Janet A. Carr, Independent Clojure Consultant
Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.
In Functional Design, renowned software engineer Robert C. Martin ("Uncle Bob") explains how and why to use functional programming to build better systems for real customers. 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.
Martin's approach is pragmatic, minimizing theory in favor of "in the-trenches" problem-solving. 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 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 exudes 'classic-on-arrival'. Bob pulls back the curtain to reveal how functional programming elements make software design simple yet pragmatic. He does so without alienating experienced object-oriented programmers coming from languages like C#, C++, or Java."
--Janet A. Carr, Independent Clojure Consultant
Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.
Weitere Details
Sprache
Englisch
Verlagsort
Boston
USA
Verlagsgruppe
Pearson Education (US)
Zielgruppe
Für Beruf und Forschung
Dateigröße
36,32 MB
ISBN-13
978-0-13-817648-8 (9780138176488)
Copyright in bibliographic data and cover images is held by Nielsen Book Services Limited or by the publishers or by their respective licensors: all rights reserved.
Schweitzer Klassifikation
Weitere Ausgaben
Person
Robert C. Martin ("Uncle Bob") wrote his first line of code at the age of 12 in 1964 and has been employed as a programmer since 1970. He is cofounder of cleancoders.com, offering online video training for software developers, and is founder of Uncle Bob Consulting LLC, offering software consulting, training, and skill development services to major corporations worldwide. He served as the Master Craftsman at 8th Light, Inc., a Chicago-based software consulting firm. Mr. Martin has published dozens of articles in various trade journals, authored many books, and is a regular speaker at international conferences and trade shows.
Inhalt
Foreword xiii
Preface xv
Acknowledgments xxi
About the Author xxiii
Part I: Functional Basics 1
Chapter 1: Immutability 3
What Is Functional Programming? 4
The Problem with Assignment 7
So Why Is It Called Functional? 10
No Change of State? 12
Immutability 15
Chapter 2: Persistent Data 17
On Cheating 19
Making Copies 20
Structural Sharing 23
Chapter 3: Recursion and Iteration 27
Iteration 28
Recursion 32
Chapter 4: Laziness 37
Lazy Accumulation 40
OK, but Why? 41
Coda 42
Chapter 5: Statefulness 43
When We MUST Mutate 47
Software Transactional Memory (STM) 48
Life Is Hard, Software Is Harder 51
Part II: Comparative Analysis 53
Chapter 6: Prime Factors 55
Java Version 56
Clojure Version 60
Conclusion 63
Chapter 7: Bowling Game 65
Java Version 66
Clojure Version 71
Conclusion 75
Chapter 8: Gossiping Bus Drivers 77
Java Solution 78
Clojure 88
Conclusion 93
Chapter 9: Object-Oriented Programming 95
Functional Payroll 98
Namespaces and Source Files 107
Conclusion 108
Chapter 10: Types 109
Part III: Functional Design 115
Chapter 11: Data Flow 117
Chapter 12: SOLID 125
The Single Responsibility Principle (SRP) 126
The Open-Closed Principle (OCP) 131
The Liskov Substitution Principle (LSP) 138
The Interface Segregation Principle (ISP) 147
The Dependency Inversion Principle (DIP) 152
Part IV: Functional Pragmatics 181
Chapter 13: Tests 183
But What about the REPL? 184
What about Mocks? 184
Property-Based Testing 186
A Diagnostic Technique 190
Functional 197
Chapter 14: GUI 199
Turtle-Graphics in Quil 200
Chapter 15: Concurrency 215
Conclusion 225
Part V: Design Patterns 227
Chapter 16: Design Patterns Review 229
Patterns in Functional Programming 233
Abstract Server 233
Adapter 236
Command 242
Composite 249
Decorator 260
Visitor 264
Abstract Factory 274
Conclusion 281
Postscript: OO Poison? 282
Part VI: Case Study 285
Chapter 17: Wa-Tor 287
Scratch That Itch 309
Showers Solve Problems 312
It's Time to Wildly Reproduce 322
What about the Sharks? 324
Conclusion 335
Afterword 337
Index 341
Preface xv
Acknowledgments xxi
About the Author xxiii
Part I: Functional Basics 1
Chapter 1: Immutability 3
What Is Functional Programming? 4
The Problem with Assignment 7
So Why Is It Called Functional? 10
No Change of State? 12
Immutability 15
Chapter 2: Persistent Data 17
On Cheating 19
Making Copies 20
Structural Sharing 23
Chapter 3: Recursion and Iteration 27
Iteration 28
Recursion 32
Chapter 4: Laziness 37
Lazy Accumulation 40
OK, but Why? 41
Coda 42
Chapter 5: Statefulness 43
When We MUST Mutate 47
Software Transactional Memory (STM) 48
Life Is Hard, Software Is Harder 51
Part II: Comparative Analysis 53
Chapter 6: Prime Factors 55
Java Version 56
Clojure Version 60
Conclusion 63
Chapter 7: Bowling Game 65
Java Version 66
Clojure Version 71
Conclusion 75
Chapter 8: Gossiping Bus Drivers 77
Java Solution 78
Clojure 88
Conclusion 93
Chapter 9: Object-Oriented Programming 95
Functional Payroll 98
Namespaces and Source Files 107
Conclusion 108
Chapter 10: Types 109
Part III: Functional Design 115
Chapter 11: Data Flow 117
Chapter 12: SOLID 125
The Single Responsibility Principle (SRP) 126
The Open-Closed Principle (OCP) 131
The Liskov Substitution Principle (LSP) 138
The Interface Segregation Principle (ISP) 147
The Dependency Inversion Principle (DIP) 152
Part IV: Functional Pragmatics 181
Chapter 13: Tests 183
But What about the REPL? 184
What about Mocks? 184
Property-Based Testing 186
A Diagnostic Technique 190
Functional 197
Chapter 14: GUI 199
Turtle-Graphics in Quil 200
Chapter 15: Concurrency 215
Conclusion 225
Part V: Design Patterns 227
Chapter 16: Design Patterns Review 229
Patterns in Functional Programming 233
Abstract Server 233
Adapter 236
Command 242
Composite 249
Decorator 260
Visitor 264
Abstract Factory 274
Conclusion 281
Postscript: OO Poison? 282
Part VI: Case Study 285
Chapter 17: Wa-Tor 287
Scratch That Itch 309
Showers Solve Problems 312
It's Time to Wildly Reproduce 322
What about the Sharks? 324
Conclusion 335
Afterword 337
Index 341
Systemvoraussetzungen
Dateiformat: ePUB
Kopierschutz: Wasserzeichen-DRM (Digital Rights Management)
Systemvoraussetzungen:
- Computer (Windows; MacOS X; Linux): Verwenden Sie eine Lese-Software, die das Dateiformat ePUB verarbeiten kann: z.B. Adobe Digital Editions oder FBReader – beide kostenlos (siehe E-Book Hilfe).
- Tablet/Smartphone (Android; iOS): Installieren Sie die App Adobe Digital Editions oder eine andere Leseapp für E-Books, z.B. PocketBook (siehe E-Book Hilfe).
- E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m.
Das Dateiformat ePUB ist sehr gut für Romane und Sachbücher geeignet - also für „fließenden” Text ohne komplexes Layout. Bei E-Readern oder Smartphones passt sich der Zeilen- und Seitenumbruch automatisch den kleinen Displays an.
Mit Wasserzeichen-DRM wird hier ein „weicher” Kopierschutz verwendet. Daher ist technisch zwar alles möglich – sogar eine unzulässige Weitergabe. Aber an sichtbaren und unsichtbaren Stellen wird der Käufer des E-Books als Wasserzeichen hinterlegt, sodass im Falle eines Missbrauchs die Spur zurückverfolgt werden kann.
Weitere Informationen finden Sie in unserer E-Book Hilfe.