Suppose we have 2 tables 'Departments' & 'Users'. There is also another table called 'UserDeps' for user<->department relation. For the first 2 tables we have 2 classes for domain objects. There is a layer in the app. for converting tables into objects and vice versa.
Now The Problem: I have a method like this: List GetDepartmentUsers(long depid);
My question is : Where do you put this method?
- As a static method inside 'Department' class? ( obviously syntax would be something like this :
List<Users> GetDepartmentUsers(long depid, DataHelper dh);
- As an instance method for every 'Department' object?
Department dep = new Department(depid);
DataHelper dh = new DataHelper();
dep.GetDepartmentUsers(dh);
Note: 'DataHelper' is a class which handles DB/SQL operations.