Hi guys I have a question on how to go about doing what Im trying to do here. I have a solution with three projects, a web project (VB
), a business layer class library, and a data layer class library.
This is not exactly the objects, but here is a good way to understand my problem. Lets say I have a business class named person with three properties:
Public Class Person
Private m_firstName As String
Private m_lastName As String
Private m_personID As String
Public Property FirstName() As String
In the web project, I fill the properties from input texts (except id of course), not a problem there. However, I have a method within my business object named Load (lets just assume it's suppossed to retrieve the first person it finds in the db). Within the method I create another object from the data layer object to retrieve the data.
--from codebehind --
Dim FirstPerson As BusinessLayer.Person
--from the person business object--
Public Sub Load()
Dim DLPerson As New DataLayer.PersonDataClass
--from the data layer project--
Public Class PersonDataClass
Public Sub RetrieveFirstPerson(ByRef thePerson As BusinessLayer.Person)
'-- pull data from db and fill object
thePerson.FirstName = ...
thePerson.LastName = ...
My issue here is that both the business layer and data layer seem to need to reference to each other, which causes a circular dependancy error. Can anyone offer a solution for this situation and still keep the architecture? Is there a way to reference the DLL's without making them all part of one project?
Thanks in advance,