How to pass objects between layers?

D

deko

I have a Solution with 3 Projects, representing 3 layers:

App_BL
App_DA
App_UI

All in Namespace APP

UI is a Windows Forms app and BL and DA are class libraries.

If I enter "APP." in a class in the UI layer, Intellisense shows all public
classes in the BL and DA layers - but if I try that in the BL or DA layers,
I only see the pubic classes in that layer (so I can't get a reference to a
BL object in the DL layer).

Is this by design, or is perhaps something wrong with my Solution and/or
Project settings? If it is by design, how then does one pass objects
between layers?

Thanks in advance.
 
M

Michael Nemtsev

Hello deko,

It seems that your have references to all App_* in your UI APP and no references
to App_UI in other projects
What kind of objects are u going to pass and in which environment? local
machine, intranet with physical tiers?

d> I have a Solution with 3 Projects, representing 3 layers:
d>
d> App_BL
d> App_DA
d> App_UI
d> All in Namespace APP
d>
d> UI is a Windows Forms app and BL and DA are class libraries.
d>
d> If I enter "APP." in a class in the UI layer, Intellisense shows all
d> public classes in the BL and DA layers - but if I try that in the BL
d> or DA layers, I only see the pubic classes in that layer (so I can't
d> get a reference to a BL object in the DL layer).
d>
d> Is this by design, or is perhaps something wrong with my Solution
d> and/or Project settings? If it is by design, how then does one pass
d> objects between layers?
d>
d> Thanks in advance.
d>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
D

deko

It seems that your have references to all App_* in your UI APP and no
references to App_UI in other projects

Okay, I got it - right click on the References folder under the Project's
icon in Solution Explorer and add a reference to the other Projects. But, I
can't add a reference to App_BL from App_DA - I get an error saying it would
create a circular reference...
What kind of objects are u going to pass and in which environment? local
machine, intranet with physical tiers?

just regular objects...
 
J

Joanna Carter [TeamB]

"deko" <[email protected]> a écrit dans le message de (e-mail address removed)...

| Okay, I got it - right click on the References folder under the Project's
| icon in Solution Explorer and add a reference to the other Projects. But,
I
| can't add a reference to App_BL from App_DA - I get an error saying it
would
| create a circular reference...

That's because yoou should not be letting the App_DA see the App_BL
assembly. Use reflection in the DA assembly, you don't need to see the BL
types.

Joanna
 

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