By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,963 Members | 1,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,963 IT Pros & Developers. It's quick & easy.

Referencing Projects Question

P: n/a
Joe
Hello All:

I need some help understanding project references. I have two projects that
are giving me grief. They are called Business and Messaging.

The Business proejct contains classes that handle the business layer. These
handle database calls that return data from the system's databases. It
contains classes like Policy, Unit and Vehicle. Currently, the Business
project has no reference to the Messaging project.

The Messaging project handles calls to a third-party system and uses
Business' classes (Unit, Policy and Vehicle). For example, The Messaging
class will use a Business.Vehicle class which holds information about a
Vehicle to request information from the third-party system about that
vehicle. Currently, the Messaging project has a reference to the Business
project.

If I delete the Messaging project's reference to the Business project and
create a reference to the Messaging project in the Business project, the
Messaging classes' method calls can not use the Policy, Unit or Vehicle
classes. An example of the message that is displayed is "Type
Business.Policy is not defined."

Why?

Finally, I need to architect this such that the Business project references
the Messaging project. I want to be able to pass Busienss classes to
Messaging classes so that the Messaging classes can retrieve data from the
third-party and pass that data back to the Business classes (i.e. act as a
database layer). Does anyone have an idea how I could do this?

I hope that I have been somewhat clear.

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
> If I delete the Messaging project's reference to the Business project and
create a reference to the Messaging project in the Business project, the
Messaging classes' method calls can not use the Policy, Unit or Vehicle
classes. An example of the message that is displayed is "Type
Business.Policy is not defined."
I believe, you have already identified that a circular
reference between projects is not allowed. Meaning ,if bussiness references
messaging, messaging cannot have a refernce back to bussiness.
I want to be able to pass Busienss classes to
Messaging classes so that the Messaging classes can retrieve data from the
third-party and pass that data back to the Business classes (i.e. act as a
database layer). Does anyone have an idea how I could do this?
while waiting to hear from experts, One simple method to handle this
is to define your data structure (c# struct) (the data you pass between
message & bussiness) in a seperate proj so both message & bussiness can
reference and pass it between calls.. Doesnt hurt if used in small projects.
I am sure there will be another systematic, efficient design approch...
"Joe" wrote:
Hello All:

I need some help understanding project references. I have two projects that
are giving me grief. They are called Business and Messaging.

The Business proejct contains classes that handle the business layer. These
handle database calls that return data from the system's databases. It
contains classes like Policy, Unit and Vehicle. Currently, the Business
project has no reference to the Messaging project.

The Messaging project handles calls to a third-party system and uses
Business' classes (Unit, Policy and Vehicle). For example, The Messaging
class will use a Business.Vehicle class which holds information about a
Vehicle to request information from the third-party system about that
vehicle. Currently, the Messaging project has a reference to the Business
project.

If I delete the Messaging project's reference to the Business project and
create a reference to the Messaging project in the Business project, the
Messaging classes' method calls can not use the Policy, Unit or Vehicle
classes. An example of the message that is displayed is "Type
Business.Policy is not defined."

Why?

Finally, I need to architect this such that the Business project references
the Messaging project. I want to be able to pass Busienss classes to
Messaging classes so that the Messaging classes can retrieve data from the
third-party and pass that data back to the Business classes (i.e. act as a
database layer). Does anyone have an idea how I could do this?

I hope that I have been somewhat clear.

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

Nov 19 '05 #2

P: n/a
Joe
Sreejith,

Thanks for your reply. The idea was to remove the Busienss reference from
Messaging and have in its place a Messaging reference in Business.

Joe
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Sreejith Ram" wrote:
If I delete the Messaging project's reference to the Business project and
create a reference to the Messaging project in the Business project, the
Messaging classes' method calls can not use the Policy, Unit or Vehicle
classes. An example of the message that is displayed is "Type
Business.Policy is not defined."


I believe, you have already identified that a circular
reference between projects is not allowed. Meaning ,if bussiness references
messaging, messaging cannot have a refernce back to bussiness.
I want to be able to pass Busienss classes to
Messaging classes so that the Messaging classes can retrieve data from the
third-party and pass that data back to the Business classes (i.e. act as a
database layer). Does anyone have an idea how I could do this?


while waiting to hear from experts, One simple method to handle this
is to define your data structure (c# struct) (the data you pass between
message & bussiness) in a seperate proj so both message & bussiness can
reference and pass it between calls.. Doesnt hurt if used in small projects.
I am sure there will be another systematic, efficient design approch...
"Joe" wrote:
Hello All:

I need some help understanding project references. I have two projects that
are giving me grief. They are called Business and Messaging.

The Business proejct contains classes that handle the business layer. These
handle database calls that return data from the system's databases. It
contains classes like Policy, Unit and Vehicle. Currently, the Business
project has no reference to the Messaging project.

The Messaging project handles calls to a third-party system and uses
Business' classes (Unit, Policy and Vehicle). For example, The Messaging
class will use a Business.Vehicle class which holds information about a
Vehicle to request information from the third-party system about that
vehicle. Currently, the Messaging project has a reference to the Business
project.

If I delete the Messaging project's reference to the Business project and
create a reference to the Messaging project in the Business project, the
Messaging classes' method calls can not use the Policy, Unit or Vehicle
classes. An example of the message that is displayed is "Type
Business.Policy is not defined."

Why?

Finally, I need to architect this such that the Business project references
the Messaging project. I want to be able to pass Busienss classes to
Messaging classes so that the Messaging classes can retrieve data from the
third-party and pass that data back to the Business classes (i.e. act as a
database layer). Does anyone have an idea how I could do this?

I hope that I have been somewhat clear.

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

Nov 19 '05 #3

P: n/a
for a project to use classes defined in another project, it needs a
reference. if you want business to reference messaging, and messaging to use
clsses defined in business, yo have two options:

1) merge them into 1 project.
2) create a third project (ref'd by both business and message) that defines
the shared classes. the best approach whould be to define abstact classes
here, and allow the business layer to implement it.

-- bruce (sqlwork.com)
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:94**********************************@microsof t.com...
Sreejith,

Thanks for your reply. The idea was to remove the Busienss reference from
Messaging and have in its place a Messaging reference in Business.

Joe
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Sreejith Ram" wrote:
> If I delete the Messaging project's reference to the Business project
> and
> create a reference to the Messaging project in the Business project,
> the
> Messaging classes' method calls can not use the Policy, Unit or Vehicle
> classes. An example of the message that is displayed is "Type
> Business.Policy is not defined."


I believe, you have already identified that a circular
reference between projects is not allowed. Meaning ,if bussiness
references
messaging, messaging cannot have a refernce back to bussiness.
> I want to be able to pass Busienss classes to
> Messaging classes so that the Messaging classes can retrieve data from
> the
> third-party and pass that data back to the Business classes (i.e. act
> as a
> database layer). Does anyone have an idea how I could do this?


while waiting to hear from experts, One simple method to handle
this
is to define your data structure (c# struct) (the data you pass between
message & bussiness) in a seperate proj so both message & bussiness can
reference and pass it between calls.. Doesnt hurt if used in small
projects.
I am sure there will be another systematic, efficient design approch...
"Joe" wrote:
> Hello All:
>
> I need some help understanding project references. I have two projects
> that
> are giving me grief. They are called Business and Messaging.
>
> The Business proejct contains classes that handle the business layer.
> These
> handle database calls that return data from the system's databases. It
> contains classes like Policy, Unit and Vehicle. Currently, the
> Business
> project has no reference to the Messaging project.
>
> The Messaging project handles calls to a third-party system and uses
> Business' classes (Unit, Policy and Vehicle). For example, The
> Messaging
> class will use a Business.Vehicle class which holds information about a
> Vehicle to request information from the third-party system about that
> vehicle. Currently, the Messaging project has a reference to the
> Business
> project.
>
> If I delete the Messaging project's reference to the Business project
> and
> create a reference to the Messaging project in the Business project,
> the
> Messaging classes' method calls can not use the Policy, Unit or Vehicle
> classes. An example of the message that is displayed is "Type
> Business.Policy is not defined."
>
> Why?
>
> Finally, I need to architect this such that the Business project
> references
> the Messaging project. I want to be able to pass Busienss classes to
> Messaging classes so that the Messaging classes can retrieve data from
> the
> third-party and pass that data back to the Business classes (i.e. act
> as a
> database layer). Does anyone have an idea how I could do this?
>
> I hope that I have been somewhat clear.
>
> TIA,
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

Nov 19 '05 #4

P: n/a
Joe
Bruce,

How would option 2 work? Would you please give an example showing how to do
this or do you know of an example online soimewhere?

Thanks,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Bruce Barker" wrote:
for a project to use classes defined in another project, it needs a
reference. if you want business to reference messaging, and messaging to use
clsses defined in business, yo have two options:

1) merge them into 1 project.
2) create a third project (ref'd by both business and message) that defines
the shared classes. the best approach whould be to define abstact classes
here, and allow the business layer to implement it.

-- bruce (sqlwork.com)
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:94**********************************@microsof t.com...
Sreejith,

Thanks for your reply. The idea was to remove the Busienss reference from
Messaging and have in its place a Messaging reference in Business.

Joe
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Sreejith Ram" wrote:
> If I delete the Messaging project's reference to the Business project
> and
> create a reference to the Messaging project in the Business project,
> the
> Messaging classes' method calls can not use the Policy, Unit or Vehicle
> classes. An example of the message that is displayed is "Type
> Business.Policy is not defined."

I believe, you have already identified that a circular
reference between projects is not allowed. Meaning ,if bussiness
references
messaging, messaging cannot have a refernce back to bussiness.

> I want to be able to pass Busienss classes to
> Messaging classes so that the Messaging classes can retrieve data from
> the
> third-party and pass that data back to the Business classes (i.e. act
> as a
> database layer). Does anyone have an idea how I could do this?

while waiting to hear from experts, One simple method to handle
this
is to define your data structure (c# struct) (the data you pass between
message & bussiness) in a seperate proj so both message & bussiness can
reference and pass it between calls.. Doesnt hurt if used in small
projects.
I am sure there will be another systematic, efficient design approch...
"Joe" wrote:

> Hello All:
>
> I need some help understanding project references. I have two projects
> that
> are giving me grief. They are called Business and Messaging.
>
> The Business proejct contains classes that handle the business layer.
> These
> handle database calls that return data from the system's databases. It
> contains classes like Policy, Unit and Vehicle. Currently, the
> Business
> project has no reference to the Messaging project.
>
> The Messaging project handles calls to a third-party system and uses
> Business' classes (Unit, Policy and Vehicle). For example, The
> Messaging
> class will use a Business.Vehicle class which holds information about a
> Vehicle to request information from the third-party system about that
> vehicle. Currently, the Messaging project has a reference to the
> Business
> project.
>
> If I delete the Messaging project's reference to the Business project
> and
> create a reference to the Messaging project in the Business project,
> the
> Messaging classes' method calls can not use the Policy, Unit or Vehicle
> classes. An example of the message that is displayed is "Type
> Business.Policy is not defined."
>
> Why?
>
> Finally, I need to architect this such that the Business project
> references
> the Messaging project. I want to be able to pass Busienss classes to
> Messaging classes so that the Messaging classes can retrieve data from
> the
> third-party and pass that data back to the Business classes (i.e. act
> as a
> database layer). Does anyone have an idea how I could do this?
>
> I hope that I have been somewhat clear.
>
> TIA,
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.