I'm reorganizing our BI layers to make our code more “loosely coupled,” and I was interested to hear what you guys thought might be interesting improvements?
Currently, our API looks something like this: -
ProductCollection prods = Product.GetProducts();
Product p = new Product();
if(p.Load(productID))
{
p.Name = "New Name";
p.Save();
}
As you can see, our methods for collecting object collections / loading individual objects and saving changes are all built into the Model class. Each of our Model classes inherits the base ObjectBase class, which includes database access and change tracking functions, so when someone changes a value through a property, the object is automatically marked as dirty and notifications are triggered on any object (UI) subscribed to these developments.
, , " ", . , , , , "" . . , -
List<Product> prods = ProductService.GetProducts();
Product p = ProductService.GetSingleProduct(productID);
p.Name = "New Name";
ProductService.SaveProduct(p);
-.
- , , , ?