Bouncing Tiers

F

Freaky Coder

Can anyone tell me if I'm insane or not?

I have a problem where I have a data tier where every class represents a
table, and a class can have properties which are object of another class.
For instance:
Data.Car.Driver ' A Driver class
Data.Car.Passengers ' A Passenger collection class

The problem is, if I then have a business layer that inherits from the data
layer, and I then use the business layer in my UI, the object namespaces can
get out of whack, for instance:
Business.Car.Driver ' Driver comes back as Data.Car.Drvier, because the
implementation code says to return a data driver class.

Now, there's not much I can do about that. So I came up with this idea:
The UI uses the Data objects, which inherits from the Business objects (the
opposite of before). So now in my Data code when I want a property that
isn't an object, say Data.Car.VIN the code looks something like this:
Public Property VIN() As String
Get
' Database implementation code
' Gets the data from the database
' Hands it to the Base (Business) which does its magic
Return(MyBase.VIN)
End Get
Set (ByVal Value As String)
MyBase.VIN = Value
' Database implementation code
End Set
End Property

So basically the DAL gets the data first then hands it off to the Business
which does what it needs to do, then that data goes back to the DAL and
either inserts/updates or outputs. Hence why I call it "Bouncing Tiers".

Now does anyone have a problem with this? I'm very interested in hearing
anyone's opinion.

Horribly Frustrated
 
F

Fergus Cooney

Hi Freaky

You said
|| Business.Car.Driver ' Driver comes back as Data.Car.Drvier,
because the
|| implementation code says to return a data driver class.

I don't understand the problem yet, can you show us some code?
Maybe we can then dry those tiers of frustration.

Regards,
Fergus

ps. If you can still ask the question, you're probably not insane. But you
are a little freaky, lol.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top