What is copy-on-write?

I was going to write up my own explanation but this Wikipedia article pretty much sums it up. Here is the basic concept: Copy-on-write (sometimes referred to as “COW”) is an optimization strategy used in computer programming. The fundamental idea is that if multiple callers ask for resources which are initially indistinguishable, you can give … Read more

How do the Proxy, Decorator, Adapter, and Bridge Patterns differ?

Proxy, Decorator, Adapter, and Bridge are all variations on “wrapping” a class. But their uses are different. Proxy could be used when you want to lazy-instantiate an object, or hide the fact that you’re calling a remote service, or control access to the object. Decorator is also called “Smart Proxy.” This is used when you … Read more