This course explores protocols and behaviours in Elixir, enabling polymorphism and defining contracts for modules. We'll learn how to define and implement protocols, create behaviours, and build flexible, extensible systems.
Overview
Syllabus
- Unit 1: Defining Elixir Protocols
- Customizing Protocol Output for Lists
- Add Protocol Support for Atoms
- Sum Values with a Custom Protocol
- Count Anything with Protocols
- Unit 2: Protocols with Custom Structs
- Add and Use a New Struct Field
- Add a Protocol Implementation for Order
- Protocols and Structs in Action
- Unit 3: Defining Elixir Behaviours
- Handle Missing Keys on Delete
- Add a Key Existence Check
- Build a Complete Storage Behaviour
- Build a Custom Key Value Store
- Unit 4: Building Polymorphic Systems
- Strengthen Email Validation Logic
- Add a New Validatable Address Type
- Validate Lists with Protocols
- Polymorphic Validation System from Scratch