Design Patterns and Idioms
- Q210: How does trait delegation with 'by' work in EK9?
- Q211: How do I implement double dispatch in EK9?
- Q212: How do I apply the composition-over-inheritance pattern in EK9?
- Q213: How do I protect shared data with MutexLock in EK9?
- Q214: How do I implement the strategy pattern in EK9?
- Q261: What is idiomatic EK9 code?
- Q262: How do I implement the observer pattern in EK9?
- Q263: How do I implement the factory pattern in EK9?
- Q264: How do I implement the adapter pattern in EK9?
- Q265: How do I implement a fluent API in EK9?
- Q266: How do I handle cross-cutting concerns in EK9?
- Q267: What are common EK9 anti-patterns to avoid?
- Q1115: Create an aspect that transparently proxies a component's method call.
- Q1116: Create an aspect that takes a label in its constructor for identification.
- Q1117: Handle an exception that occurs inside an aspect-proxied component call.
- Q1118: Apply an aspect to a component that has multiple methods.
- Q1119: Register a component with an aspect and verify the aspect proxy is transparent.
- Q1120: Register a component without an aspect to show the baseline behaviour.
- Q1121: Write a dispatcher over a sealed Shape hierarchy with Circle, Square, and Triangle.
- Q1122: Write a dispatcher with a fallback handler for unmatched types.
- Q1123: Dispatch on a deep class hierarchy where exact match wins over parent handler.
- Q1124: Dispatch on two parameters to handle different shape combinations.
- Q1238: Implement me a strategy pattern for applying different discount calculations to a price, using an abstract function and two dynamic function strategies.
- Q1248: Implement me a chain-of-responsibility pattern using abstract function handlers, where each handler tries to process a String and either returns a result or returns unset to pass on to the next handler.