This has been bothering me. This is more of a pragmatic problem than technical. Imagine I have a SaveOrderChanges method which, as its name implies, will save the order changes when the user submits the modified order.
But, before saving the order, I need to verify if the order submitted is actually from the current user, so I proceed to do a simple verification in the DB. I have a special method that works with this situation which I've called "VerifyOrder()".
The true question is if the SaveOrderChanges() method should include the call to that method, or should the other method be called before SaveOrderChanges() is called
imagine I have some method like this:
Do I make it like this :
public bool SaveOrderChanges(Order order)
{
VerifyOrder(order); //Verify that the order is from the actual user
//Some Code Logic in here
}
Or like this:
if(VerifyOrder(order))
{
SaveOrderChanges(order);
}