A
Angel
I'm in the process of working on a Windows payroll application but I wanted
some help on what design pattern I should use. For example, if my main Form
needs all active employees in the DB, I'd call from within the form, a
method called activeEmployees from class Employees. Then I'd have another
class Connection that would do the actual connection to the DB (Oracle or
SQL Server).
I've tried this before but I get stuck when sending data from one class to
the other. For example, after activeEmployees() is called during a button
click, from where should I instantiate the Connection class and call
makeConnection(DB)? And, once Connection.makeConnection(DB) is executed and
the DB is open, how will Employees.activeEmployees() have access to that
open connection? And finally, how would I be able to send that data in
activeEmployees to the initial button click that called it?
Any help would be appreciated.
some help on what design pattern I should use. For example, if my main Form
needs all active employees in the DB, I'd call from within the form, a
method called activeEmployees from class Employees. Then I'd have another
class Connection that would do the actual connection to the DB (Oracle or
SQL Server).
I've tried this before but I get stuck when sending data from one class to
the other. For example, after activeEmployees() is called during a button
click, from where should I instantiate the Connection class and call
makeConnection(DB)? And, once Connection.makeConnection(DB) is executed and
the DB is open, how will Employees.activeEmployees() have access to that
open connection? And finally, how would I be able to send that data in
activeEmployees to the initial button click that called it?
Any help would be appreciated.