473,382 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Abstraction question

I am using dOOdads as my persistence layer.

I have a business object Person that sits in a Project called DOMAIN
I have 2 dOOdads in a project called BLL.

one is _Person and is declared MustInherit
the other is Person and is my concrete class.

My main goal of BLL.Person is to protect custom methods and properties
against regeneration.

DOMAIN.Person is my actual object for all my Rules and such for person.

so in DOMAIN.Person I have code like this

Private _person As BLL.Person

Public Function getPersonByID(ByVal id As Integer) As BLL.Person

If _person.LoadByPrimaryKey(id) = False Then
Throw New Person.InvalidPersonException
End If
Return _person

End Function

The problem is I am getting the following error in my compiler:
Construct makes an indirect reference to project 'WavelengthIS.CMR.BLL',
which contains 'WavelengthIS.CMR.BLL.Person'. Add a project reference to
'WavelengthIS.CMR.BLL' to your project. C:\Documents and
Settings\ecathell\My Documents\Visual Studio
2005\Projects\WavelengthIS\CMR-Versioned\NunitTESTS\Form1.Designer.vb

Now I am sure there is some design way around this. I am just delving into
some of the more complex patterns and the thought is at the tip of my brain.
I am missing an interface somewhere( probably in my function) as IPerson.

but if I do an interface on IPerson...how do I maintain the bll._person to
bll.Person inheritence?

Hopefully what I am asking makes some kind of sense.
Sep 6 '06 #1
2 1792
Sept. 6, 2006

I don't quite understand the question completely, but if you are wanting
your code to work and explain why the error is occuring.... it may be
because you have declared a variable "_person" which is the exact same name
as the MustInherit class _Person (I don't believe class names & variables
are case-insensitive in C#... like if you have Button1 object on your
windows form, you can't declare "button1" in your code.)

So anyway, try changing your _person variable to something else like
"persontoreturn" or something.

Hope this helps and is what you were asking for!
--
Joseph Bittman
Microsoft Certified Solution Developer
Microsoft Most Valuable Professional -- DPM

Web Site/Blog: http://CactiDevelopers.ResDev.Net/

"Eric Cathell" <de**********@community.nospamwrote in message
news:ed****************@TK2MSFTNGP05.phx.gbl...
>I am using dOOdads as my persistence layer.

I have a business object Person that sits in a Project called DOMAIN
I have 2 dOOdads in a project called BLL.

one is _Person and is declared MustInherit
the other is Person and is my concrete class.

My main goal of BLL.Person is to protect custom methods and properties
against regeneration.

DOMAIN.Person is my actual object for all my Rules and such for person.

so in DOMAIN.Person I have code like this

Private _person As BLL.Person

Public Function getPersonByID(ByVal id As Integer) As BLL.Person

If _person.LoadByPrimaryKey(id) = False Then
Throw New Person.InvalidPersonException
End If
Return _person

End Function

The problem is I am getting the following error in my compiler:
Construct makes an indirect reference to project 'WavelengthIS.CMR.BLL',
which contains 'WavelengthIS.CMR.BLL.Person'. Add a project reference to
'WavelengthIS.CMR.BLL' to your project. C:\Documents and
Settings\ecathell\My Documents\Visual Studio
2005\Projects\WavelengthIS\CMR-Versioned\NunitTESTS\Form1.Designer.vb

Now I am sure there is some design way around this. I am just delving into
some of the more complex patterns and the thought is at the tip of my
brain. I am missing an interface somewhere( probably in my function) as
IPerson.

but if I do an interface on IPerson...how do I maintain the bll._person to
bll.Person inheritence?

Hopefully what I am asking makes some kind of sense.

Sep 6 '06 #2
I got that issue solved but lets carry on with this conversation. I think I
am confused about abstraction.
we have a class

Namespace myCompany.MyProgram.DAL
Protected MustInherit Class _Person

members
properties
methods

end Class
end Namespace

Now This class is kept in a separate project so that DAL will compile into
its own DLL.

next we have this

imports myCompany.MyProgram.DAL

Namespace myCompany.MyProgram.BLL
Public Class Person
Inherits _Person

members
properties
methods

end Class
end Namespace

Once again this is kept in a separate project so that BLL will compile into
its own DLL.

Now if I want to create a facade layer(because person has several dependent
objects that the end user really doesnt need to know about.

So now I have

Namespace myCompany.MyProgram.Domain
Public class PersonFacade

private _p as Person

public sub new()
_p=new Person
end sub
public sub SimplePersonMethodAccessor
_p.DoSomething

End Class
End NameSpace

Now my PersonFacade must have a reference to BLL *AND* DLL otherwise the
properties and such in DLL wont be visible. (maybe my visibility is wrong)
How is this abstracting? I understand why the reference is needed to
BLL...but why DLL too? Shouldn't DLL be totally insulated from knowledge?

It seems a lot of the patterns I have been looking over work logically
well...until you throw in a datastore. Then the reasons for decorators or
bridges or strategy patterns disappear...

I have been looking into NHibernate..but I am working on a large project so
I am using dOOdads instead. But I want a good level of abstraction between
my web interface and my BLL thus the facade...But if I ever had to change
the backend implementation or the datalayer changed for some reason I need
to know that I am abstracted enough from the interface.

I have read Headfirst Design patterns. I have the Wrox Professional design
patterns book. But like I said none of them really tackle patterns from the
point of having a persistence layer. A lot of the reason for the some of the
patterns are invalidated(in my mind) when you have a datastore.
"Joseph Bittman MVP MCSD" <Ry*********@msn.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Sept. 6, 2006

I don't quite understand the question completely, but if you are wanting
your code to work and explain why the error is occuring.... it may be
because you have declared a variable "_person" which is the exact same
name as the MustInherit class _Person (I don't believe class names &
variables are case-insensitive in C#... like if you have Button1 object
on your windows form, you can't declare "button1" in your code.)

So anyway, try changing your _person variable to something else like
"persontoreturn" or something.

Hope this helps and is what you were asking for!
--
Joseph Bittman
Microsoft Certified Solution Developer
Microsoft Most Valuable Professional -- DPM

Web Site/Blog: http://CactiDevelopers.ResDev.Net/

"Eric Cathell" <de**********@community.nospamwrote in message
news:ed****************@TK2MSFTNGP05.phx.gbl...
>>I am using dOOdads as my persistence layer.

I have a business object Person that sits in a Project called DOMAIN
I have 2 dOOdads in a project called BLL.

one is _Person and is declared MustInherit
the other is Person and is my concrete class.

My main goal of BLL.Person is to protect custom methods and properties
against regeneration.

DOMAIN.Person is my actual object for all my Rules and such for person.

so in DOMAIN.Person I have code like this

Private _person As BLL.Person

Public Function getPersonByID(ByVal id As Integer) As BLL.Person

If _person.LoadByPrimaryKey(id) = False Then
Throw New Person.InvalidPersonException
End If
Return _person

End Function

The problem is I am getting the following error in my compiler:
Construct makes an indirect reference to project 'WavelengthIS.CMR.BLL',
which contains 'WavelengthIS.CMR.BLL.Person'. Add a project reference to
'WavelengthIS.CMR.BLL' to your project. C:\Documents and
Settings\ecathell\My Documents\Visual Studio
2005\Projects\WavelengthIS\CMR-Versioned\NunitTESTS\Form1.Designer.vb

Now I am sure there is some design way around this. I am just delving
into some of the more complex patterns and the thought is at the tip of
my brain. I am missing an interface somewhere( probably in my function)
as IPerson.

but if I do an interface on IPerson...how do I maintain the bll._person
to bll.Person inheritence?

Hopefully what I am asking makes some kind of sense.


Sep 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rainer Collet | last post by:
hi! i tested several php database abstraction layers (db, mdb(2), creole, adodb, etc), but i always missed one really important feature: i need a method for a limited select which gives me the...
3
by: Jeff Rodriguez | last post by:
I am aware of bstrings however, a quick google search hasn't revealed a simple library for array abstraction. What are others thoughts on the bstring library and is anyone aware of an array...
6
by: Mark Broadbent | last post by:
this might sound like an obvious question but I have found that usually these two evolve at the same time. One of the biggest reasons for creating the abstraction in the first place (in my...
25
by: Colin McKinnon | last post by:
Hi all, There's lots of DB abstraction layers out there, but a quick look around them hasn't turned up anything which seems to met my requirements. Before I go off and write one I thought I'd...
1
by: rickycornell | last post by:
Greetings All, On past projects in PHP4 I had always just written my own libraries to deal with database interaction. Somehow I was operating in the dark that there were all these database...
2
by: subramanian100in | last post by:
Is my following understanding correct ? Data abstraction means providing the interface - that is, the set of functions that can be called by the user of a class. Information hiding means...
3
by: Joseph Gruber | last post by:
Hi All. I'm a PHP programer moving to ASP.NET for this project I'm working on. The project I'm working on will require that the ASP.NET application support multiple databases (e.g. Oracle,...
8
by: Ivan S | last post by:
What are your recommendations for lightweight database abstraction library (Oracle/MySQL)? I prefer OOP. :) Tnx, Ivan.
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.