Ruby Conf 12 - Boundaries by Gary Bernhardt
3 min read
7 months ago
Published on Apr 21, 2024
This response is partially generated with the help of AI. It may contain inaccuracies.
Table of Contents
Step-by-Step Tutorial: Understanding Boundaries in Software Development
-
Introduction to Boundaries:
- The talk is titled "Boundaries" by Gary Bernhardt, focusing on software development concepts.
- Gary Bernhardt introduces himself as the owner of Destroy All Software, a company producing screencasts on advanced software development topics.
-
Motivation with Test Doubles:
- Test doubles (mocking and stubbing) are introduced as a motivation for isolating unit tests.
- An example of a sweeper class in a recurring billing scenario is used to explain the concept of isolating dependencies.
-
Isolating Dependencies:
- The implementation involves isolating dependencies like the user and user mailer to focus on testing the logic of the sweeper class.
-
Benefits of Isolating Tests:
- Isolating tests allows for real test-driven design, faster tests, and provides feedback on the design quality of the code.
-
Challenges with Real Classes:
- Running tests against real classes can lead to passing tests but incorrect production system behavior, highlighting the need for isolating tests.
-
Solving Isolation Problem:
- Various approaches like testing contracts, collaboration tests, and static typing are discussed as solutions to the isolation problem in testing.
-
Functional Core and Imperative Shell:
- The concept of a functional core (logic-heavy, light on dependencies) and an imperative shell (dependency-heavy, few paths) is introduced for system design.
-
Integrating Functional and Imperative Layers:
- The imperative shell acts as a glue layer between functional components and external systems, allowing for state maintenance and communication with the outside world.
-
Concurrency and Actor Model:
- The talk touches on the actor model of concurrency and how values as boundaries between components can aid in concurrency and parallelization.
-
Scaling to Larger Systems:
- The talk discusses the potential challenges and benefits of scaling this design approach to larger software systems, emphasizing the need for well-defined boundaries and component design.
-
Implementing the Design Approach:
- The talk references a Twitter client project as an example of applying the functional core and imperative shell design approach in practice.
-
Considerations for Building Large Systems:
- Recommendations are made for building core types, lightweight processes, and user-land schedulers to support the design approach in larger systems.
-
Challenges with Existing Systems:
- The talk mentions challenges with existing systems like Twitter's test runtime and the need to consider the implications of integrating with such systems.
-
Future Directions and Recommendations:
- The talk concludes with thoughts on exploring open protocols, concurrency models, and alternative approaches to software development for future projects.
-
Closing Remarks:
- Gary Bernhardt thanks the audience for listening and invites comments or questions on the discussed concepts.
By following these steps and understanding the key insights from the talk on boundaries in software development, you can apply these concepts to improve your software design and testing strategies.