Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2006, 02:10 AM
Authorized User
 
Join Date: Mar 2004
Location: Mesa, AZ, USA.
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:06 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.