design pattern: facade for delete?
Hi guys,
I have the following info (db):
department (dep_id, name, description)
empl(empl_id, dep_id, name)
invoice (inv_id, dep_id, description).
.
.
.
question is this: say I would like to delete the department (which include the empl as well). What is the best way to do that?
obviously, I can do something like this:
1. delete department by id
2. delete user associated to department etc
the problem is that in the future there might be more information relating the department that will need to be deleted (and I'm not going to go over the code to check for deletion and add another one)
I thought that the facade design pattern can work here. I'm not sure if I'm on the right track and wonder if someone can put some light and describe how to do that.
should it be something like this:
Class DepartmentDeleteFacade(int id department)
{
//delete department
//delet users associated
.
.
.
}
thanks for any thoughts

