Seams are strategic points in code where behavior can be modified without altering the existing implementation. They are crucial for introducing changes safely, enabling testing, and refactoring legacy systems incrementally. This course explores functional, object, and preprocessor seams, and their role in improving code maintainability.
Overview
Syllabus
- Unit 1: Using Seams to Enable Testability and Expand Capabilities in C++
- Refactoring OrderProcessor with Method Extraction
- Add Customizable Order Total Calculation
- Add Custom Discount Calculation Test
- Testing Surcharge Calculation Scenario
- Unit 2: Feature Flags in C++: Enhancing Flexibility and Testability
- Implementing Order Calculation Mode Enum
- Implement Order Calculation Modes
- Add Optional Calculation Mode Parameter
- Testing Normal Calculation Mode Behavior
- Testing Order Processor Discount Mode
- Testing Surcharge Calculation in Order Processing
- Unit 3: Leveraging Inheritance for Object Seams in C++
- Preparing for Inheritance with Protected and Virtual Methods
- Implementing Inheritance with the DiscountOrderProcessor Class
- Implement Tests for Discount Order Processing
- Testing the DiscountOrderProcessor
- Unit 4: Interface Breakdown in C++: Enhancing Maintainability and Testability with Abstract Classes
- Interface Segregation Principle for Notification Services
- Refactoring AuditService with Interface Segregation
- Interface Segregation for Notification Services
- Interface Segregation for SMS Service