예제 #1
0
        /// <summary>
        /// An example of the evil that beseiges us...
        /// </summary>
        public void SomethingImportant()
        {
            // Can't be injected
            // Can't be easily mocked
            // Often leads to Cross-cutting concerns
            var prods = LogicLayer.GetProducts();

            // can be easily tested by adding a setter
            var prods2 = LogicLayerSington.Instance.GetProducts();
        }
예제 #2
0
 public List <Product> GetProducts()
 {
     return(LogicLayer.GetProducts());
 }