In today's episode we look at a potential complication of using the Decorator pattern, and discuss how to resolve it by enforcing Command/Query Separation.
Month: April 2014
Episode #197: Decorator
Today we explore the Decorator pattern, with the help of the SimpleDelegator standard library.
Episode #196: String Templates
Have you ever wanted a way to customize the format of certain generated strings, but felt like ERB or some other templating language was overkill? If so, today's episode should …
Episode #195: Advanced String Formats
Following on from the last episode, today we look at some more advanced uses of Ruby's string formatting features.
Episode #194: String Format
Sometimes Kernel#puts and string interpolation doesn't give us the level of control we want over our program's output. When we need to control numeric formatting and field widths, we need …
Episode #193: Pathname
While the File methods are great for occasional use, for programs that deal extensively in filenames we need to bring out the big guns. Today we'll get an overview of …
Episode #192: Filenames
Ruby provides a lot of tools for breaking filenames into their component parts, but they aren't always well documented. Today's episode combines goes over some basics as well as a …
Episode #191: Virtual Proxy
When loading domain objects from an external service, it can be expensive to load up associated objects with them. Today's episode takes a look at a pattern for transparently lazy-loading …