Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 12th, 2006, 02:10 AM
Authorized User
 
Join Date: Mar 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default DLL's and Circular Dependancies

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:
Code:
Public Class Person
   Private m_firstName As String
   Private m_lastName As String
   Private m_personID As String

   Public Property FirstName() As String
   ...
End Class
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.

Code:
--from codebehind --
Dim FirstPerson As BusinessLayer.Person

FirstPerson.Load

--from the person business object--
Public Sub Load()
  Dim DLPerson As New DataLayer.PersonDataClass

  DLPerson.RetrieveFirstPerson(Me)
End Sub

--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 = ...
  End Sub
End Class
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,
Rolandatem






Similar Threads
Thread Thread Starter Forum Replies Last Post
Circular Replication happygv MySQL 0 December 7th, 2006 02:57 AM
Circular reference Error robert-s Access 1 June 6th, 2006 10:31 AM
Circular queue bulletgreen BOOK: Professional C++ 0 December 15th, 2005 04:28 AM
Circular Reference Hell! RFickling C# 1 November 7th, 2004 06:38 PM
DLL's snowy0 VB.NET 1 October 1st, 2004 09:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.