G
Greg
I'm not sure I am using the proper language here, but, I'm pretty sure I
should be able to get across what I want to ask.
I have a three teir project I am working on. It contains a UI, DataAccess
and BusinessLogic teirs.
In the BusinessLogic component, I have an Employee Class that contains
Employee information named EmployeeClass.
So, in my UI component in a form I populate this class component with my
employee information. For example, I do the following to populate the class
object.
dim objEmployee as EmployeeClass
objEmployee = new EmployeeClass
objEmployee.FirstName = me.txtFirstName.text
objEmployee.LastName = me.txtLastName.text
So, with the objEmployee class object I want to pass it to my function I
have in my BusinessLogic component called InsertEmployee. I may do some
additional data cleanup here before inserting the employee. Now, once the
BusinessLogic component is done with the class object, I want to pass it on
to the DataAccess module InsertEmployee function. The InsertEmployee function
exists in both my BusinessLogic and DataAccess modules.
Now, my UI has a reference to the BusinessLogic components and my
BusinessLogic component has a reference to the DataAccess component.
My question is, how can I pass my objEmployee object from the BusinessLogic
component to the DataAccess component when the DataAccess component does not
know anything about the objEmployee class object?
My thought is to pass the entire employee objEmployee object at once. Thus
the DataAccess InsertEmployee function would look like this.
Function InsertEmployee(byval objEmployee as objEmployeeClass) as boolean
Do stuff in here with the objEmployee object and insert into database.
End Function
My problem is that the DataAccess component is not referenced to the
BusinessLogic component. I'm not sure it would be a good idea to setup a
reference to the BusinessLogic component because it kind of defeats the
purpose I think .
I hope I was able to convey what it is I am trying to do. If anyone has any
ideas or suggestions I'd appreciate to hear them.
should be able to get across what I want to ask.
I have a three teir project I am working on. It contains a UI, DataAccess
and BusinessLogic teirs.
In the BusinessLogic component, I have an Employee Class that contains
Employee information named EmployeeClass.
So, in my UI component in a form I populate this class component with my
employee information. For example, I do the following to populate the class
object.
dim objEmployee as EmployeeClass
objEmployee = new EmployeeClass
objEmployee.FirstName = me.txtFirstName.text
objEmployee.LastName = me.txtLastName.text
So, with the objEmployee class object I want to pass it to my function I
have in my BusinessLogic component called InsertEmployee. I may do some
additional data cleanup here before inserting the employee. Now, once the
BusinessLogic component is done with the class object, I want to pass it on
to the DataAccess module InsertEmployee function. The InsertEmployee function
exists in both my BusinessLogic and DataAccess modules.
Now, my UI has a reference to the BusinessLogic components and my
BusinessLogic component has a reference to the DataAccess component.
My question is, how can I pass my objEmployee object from the BusinessLogic
component to the DataAccess component when the DataAccess component does not
know anything about the objEmployee class object?
My thought is to pass the entire employee objEmployee object at once. Thus
the DataAccess InsertEmployee function would look like this.
Function InsertEmployee(byval objEmployee as objEmployeeClass) as boolean
Do stuff in here with the objEmployee object and insert into database.
End Function
My problem is that the DataAccess component is not referenced to the
BusinessLogic component. I'm not sure it would be a good idea to setup a
reference to the BusinessLogic component because it kind of defeats the
purpose I think .
I hope I was able to convey what it is I am trying to do. If anyone has any
ideas or suggestions I'd appreciate to hear them.