Book description
You want increased customer satisfaction, faster development cycles, and less wasted work. Domain-driven design (DDD) combined with functional programming is the innovative combo that will get you there. In this pragmatic, down-to-earth guide, you'll see how applying the core principles of functional programming can result in software designs that model real-world requirements both elegantly and concisely - often more so than an object-oriented approach. Practical examples in the open-source F# functional language, and examples from familiar business domains, show you how to apply these techniques to build software that is business-focused, flexible, and high quality.
Domain-driven design is a well-established approach to designing software that ensures that domain experts and developers work together effectively to create high-quality software. This book is the first to combine DDD with techniques from statically typed functional programming. This book is perfect for newcomers to DDD or functional programming - all the techniques you need will be introduced and explained.
Model a complex domain accurately using the F# type system, creating compilable code that is also readable documentation---ensuring that the code and design never get out of sync. Encode business rules in the design so that you have "compile-time unit tests," and eliminate many potential bugs by making illegal states unrepresentable. Assemble a series of small, testable functions into a complete use case, and compose these individual scenarios into a large-scale design. Discover why the combination of functional programming and DDD leads naturally to service-oriented and hexagonal architectures. Finally, create a functional domain model that works with traditional databases, NoSQL, and event stores, and safely expose your domain via a website or API.
Solve real problems by focusing on real-world requirements for your software.
What You Need:
The code in this book is designed to be run interactively on Windows, Mac and Linux.You will need a recent version of F# (4.0 or greater), and the appropriate .NET runtime for your platform.Full installation instructions for all platforms at fsharp.org.
Publisher resources
Table of contents
- Preface
- Part I. Understanding the Domain
- Part II. Modeling the Domain
-
Part III. Implementing the Model
- 8. Understanding Functions
- 9. Implementation: Composing a Pipeline
-
10. Implementation: Working with Errors
- Using the Result Type to Make Errors Explicit
- Working with Domain Errors
- Chaining Result-Generating Functions
- Using bind and map in Our Pipeline
- Adapting Other Kinds of Functions to the Two-Track Model
- Making Life Easier with Computation Expressions
- Monads and More
- Adding the Async Effect
- Wrapping Up
- 11. Serialization
- 12. Persistence
- 13. Evolving a Design and Keeping It Clean
Product information
- Title: Domain Modeling Made Functional
- Author(s):
- Release date: January 2018
- Publisher(s): Pragmatic Bookshelf
- ISBN: 9781680502541
You might also like
book
Functional and Reactive Domain Modeling
Functional and Reactive Domain Modeling teaches you how to think of the domain model in terms …
video
Design Patterns in the Real World, an Analysis-Based Approach
Alan Holub takes coders deep into the reality of Gang-of-Four design patterns, those reusable guides to …
video
Domain-Driven Design Distilled
Domain-Driven Design (DDD) software modeling delivers powerful results in practice, not just in theory, which is …
book
gRPC: Up and Running
Get a comprehensive understanding of gRPC fundamentals through real-world examples. With this practical guide, you’ll learn …