Advertisement

07.04.2008 at 09:35AM PDT, ID: 23539725
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Object oriented data access layer help

Asked by TNGIT in Software/Systems Design, C# Programming Language, Programming for ASP.NET

Tags:

I have a load of object classes in a DLL.  These objects are things like People, Addresses, Email Addresses, Telephone Numbers, etc.  Each one is represented by a class, and each class has one or more interfaces to interact with other objects.  All the interfaces are in a separate DLL.

I have a third DLL whose purpose is to serve as the data access layer and interact between these objects and the database.  

When I need to create an object, the object's constructor might call methods from the DAL to populate unknown fields within the object. For example, the Person object might have an Id in the constructor and immediately calls methods from the DAL to get the person's address and telephone number from the database.  When this happens, I pass the interface reference to the person object into the DAL method as an argument.  It should then do what it has to do and fill missing information for the person.

However, some of these pieces of missing information are stored in other objects - for example, Address, ContactNumber, which are properties and fields of the Person object.  These objects cannot be created in the DAL due to their protection level.  I don't want to make them public classes as I don't want them to be, and I don't think they need to be.

So my question is, what is the workaround to this?  Ideally I don't want any reference from the DAL to the Objects DLL - I want the mutual ground to be the interface DLL.  Is this the correct way to go about things?

If it is, I'm therefore assuming the method to initialize objects from the DAL is to have another DLL which pure function is to initialize objects in the objects DLL.  

Am i over-complicating things?  

The whole reason I separated objects from DAL into two DLL's was so that I could swap DAL for different data structures.  I'm not sure whether it's common practice to add a reference from DAL to the objects DLL.  Or whether it's necessary.  But if it is, and it is necessary, it seems to me to defeat the object of interfaces.  

Could anyone shed any light on this?  I've put max points on as I've spent all week thinking and researching what to do with this!

Start Free Trial
 
Keywords: Object oriented data access layer help
 
Loading Advertisement...
 
[+][-]07.04.2008 at 02:20PM PDT, ID: 21934929

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Software/Systems Design, C# Programming Language, Programming for ASP.NET
Tags: C#
Sign Up Now!
Solution Provided By: anyoneis
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.04.2008 at 02:36PM PDT, ID: 21934995

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.04.2008 at 03:58PM PDT, ID: 21935170

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.22.2008 at 04:10AM PDT, ID: 22288450

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]08.28.2008 at 02:01AM PDT, ID: 22332702

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628