As far as I'm know, Functions which Add/Delete/Update an object is placed in the object's class.
like
class Emp...
Emp.addEmp(Emp newEmp)
Emp.delEmp(Emp oldEmp)
Emp.updateEmp(Emp currentEmp)
and in the Emp class I place my SQL satements.
If I'm right, my question is:
I have a class, the GUI to add new instances of this class enables the user to create more than one instance with one click. so I'll need to loop on insert statement, actually it's a nested loop, so where should the loop be placed? in the GUI class where I can see all the controls, or the Controller class(I'll have to pass different variables from control) Or in the Entity class (via Controller)
e.g.
My interface is like adding items to a lists, like selecting 3 items in 1st list and 5 items in 2nd list and so on. in DB each each record represents an item and its parent list. So to insert it I need to loop through lists and entirely through items.
Any help is appreciated