I have made a separate library project that has the classes of Store, Product, Vendor, Cart.
And the question is..
How can I implement the Observer pattern in this project to achieve the following...
The program should be able to update each vendor account balance when any of his products is added to the cart. The store also must update it's contents , ie the products that are available or those that are now sold out and not show them for the customer. The cart itself must update it's value upon the addition or removal of products from it while the purchase is still not confirmed ( paid ). The product in turn may be a subject to a price change.
I made the following designations:
public class Cart : ObservableCollection<Product> , IObservable<Product>
public class Store : ObservableCollection<Product>
public class Vendor : IObserver<Product>
And the product class is a standard class with product properties...
What I have tried:
No pattern implemented yet, i made a previous version that didn't follow any design pattern