Speaking of object-oriented design, do you think to give the opportunity to save yourself in the database so that the object spoils the COHESION class?
Imagine:
Product p = new Product()
{
Name = "Joy Rider",
Price = 100,
Currency = "USD"
};
Do you think that storing this product p in DataBase is better, you need to do this as follows:
p.Save();
or in some way:
ProductServices.SaveProduct(p);
What do you think?
source
share