decorator-chaining

Decorator Chaining of Repositories and Specialized Repositories with Dependancy Injection

Right now I'm trying to figure out a way to do things smarter, and in the course of doing so all i've managed to do is use a full bottle of excedrin in a single day. Assume i have an interface called IRepository like so. public interface IRepository<T> { T Get(int id); void Add(T value); void Update(T value); void Del...

Does it matter when a decorator gets called (at the beginning or at the end of the method) in the decorator pattern?

I'm implementing a decorator pattern in Javascript. I've seen the example here in Wikipedia // Class to be decorated function Coffee() { this.cost = function() { return 1; }; } // Decorator A function Milk(coffee) { this.cost = function() { return coffee.cost() + 0.5; }; } // Decorator B function Whip(coffee) { ...