473,385 Members | 1,901 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,385 software developers and data experts.

VB .Net circular dependency error

djm
I have a method in a "Business" Class that needs to call a method in a "UI"
Class
Currently, the "UI" Class calls methods in the "Business" Class...this I
can't change.

When I tried to add a reference to the "UI" in the "Business" project, I got
an error saying I couldn't because of circular dependency...which I get.

I believe creating a public interface is probably my only option, but I'm
not exactly sure how to go about doing it. Any help or suggestions would be
greatly appreciated.

Thx,
-- djm
Apr 7 '06 #1
7 3454
A business class should never call any method in a UI class, first of all.
The purpose of separating the layers is to enable other UIs to use the
Business class(es). The Business class(es) should know nothing about the UI,
but only provide business functionality with regards to the data being
manipulated. The UI class may know anything about the publicly-exposed
members of the Business class(es).

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"djm" <dj*@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
I have a method in a "Business" Class that needs to call a method in a "UI"
Class
Currently, the "UI" Class calls methods in the "Business" Class...this I
can't change.

When I tried to add a reference to the "UI" in the "Business" project, I
got
an error saying I couldn't because of circular dependency...which I get.

I believe creating a public interface is probably my only option, but I'm
not exactly sure how to go about doing it. Any help or suggestions would
be
greatly appreciated.

Thx,
-- djm

Apr 7 '06 #2
djm
Hi Kevin and Thx for the quick response.

I agree, but I'm involved in a project to convert a very big vb6 application
into .Net and the first phrase is to just convert and integrate the new code
in to the application.

Here's the problem.
I have methods in many different business layers that need security
clearance and I need the user to supplier their password.

How can I accomplish this in n-tier architecture?

Thx,
-- djm
"Kevin Spencer" wrote:
A business class should never call any method in a UI class, first of all.
The purpose of separating the layers is to enable other UIs to use the
Business class(es). The Business class(es) should know nothing about the UI,
but only provide business functionality with regards to the data being
manipulated. The UI class may know anything about the publicly-exposed
members of the Business class(es).

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"djm" <dj*@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
I have a method in a "Business" Class that needs to call a method in a "UI"
Class
Currently, the "UI" Class calls methods in the "Business" Class...this I
can't change.

When I tried to add a reference to the "UI" in the "Business" project, I
got
an error saying I couldn't because of circular dependency...which I get.

I believe creating a public interface is probably my only option, but I'm
not exactly sure how to go about doing it. Any help or suggestions would
be
greatly appreciated.

Thx,
-- djm


Apr 7 '06 #3
You could also just create a new class that references both your UI and
Business class. But if you already have methods in the Business class
calling methods in the UI class, then your sorta screwed. You really should
considered the benefits or migration to a more structured .NET version.
..NET does not lend itself to poor OOP implementations of VB6.

"djm" <dj*@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
I have a method in a "Business" Class that needs to call a method in a "UI"
Class
Currently, the "UI" Class calls methods in the "Business" Class...this I
can't change.

When I tried to add a reference to the "UI" in the "Business" project, I
got
an error saying I couldn't because of circular dependency...which I get.

I believe creating a public interface is probably my only option, but I'm
not exactly sure how to go about doing it. Any help or suggestions would
be
greatly appreciated.

Thx,
-- djm

Apr 7 '06 #4
> Here's the problem.
I have methods in many different business layers that need security
clearance and I need the user to supplier their password.
How you handle this depends upon the type of security you're implementing.
Is it role-based, for example? In any case, the UI layer should be agnostic
of the user. All it should provide is the interface for the user to log in.
The business layer should handle the actual security. Remember, all the UI
layer is, is an interface for the user to interact with the business layer.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"djm" <dj*@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com... Hi Kevin and Thx for the quick response.

I agree, but I'm involved in a project to convert a very big vb6
application
into .Net and the first phrase is to just convert and integrate the new
code
in to the application.

Here's the problem.
I have methods in many different business layers that need security
clearance and I need the user to supplier their password.

How can I accomplish this in n-tier architecture?

Thx,
-- djm
"Kevin Spencer" wrote:
A business class should never call any method in a UI class, first of
all.
The purpose of separating the layers is to enable other UIs to use the
Business class(es). The Business class(es) should know nothing about the
UI,
but only provide business functionality with regards to the data being
manipulated. The UI class may know anything about the publicly-exposed
members of the Business class(es).

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"djm" <dj*@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
>I have a method in a "Business" Class that needs to call a method in a
>"UI"
> Class
> Currently, the "UI" Class calls methods in the "Business" Class...this
> I
> can't change.
>
> When I tried to add a reference to the "UI" in the "Business" project,
> I
> got
> an error saying I couldn't because of circular dependency...which I
> get.
>
> I believe creating a public interface is probably my only option, but
> I'm
> not exactly sure how to go about doing it. Any help or suggestions
> would
> be
> greatly appreciated.
>
> Thx,
> -- djm


Apr 7 '06 #5
SP

"djm" <dj*@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
I have a method in a "Business" Class that needs to call a method in a "UI"
Class
Currently, the "UI" Class calls methods in the "Business" Class...this I
can't change.

When I tried to add a reference to the "UI" in the "Business" project, I
got
an error saying I couldn't because of circular dependency...which I get.

I believe creating a public interface is probably my only option, but I'm
not exactly sure how to go about doing it. Any help or suggestions would
be
greatly appreciated.


Your UI should respond to events from your business layer.

SP
Apr 9 '06 #6
djm
Yep, I'm pretty much screwed, so I'm going to leave the main function that
is giving me so much grief in VB 6 for now and use xml to call the process
until we can re-architect our security model.
Thx for your input.
--
Thx,
-- djm
"Rob R. Ainscough" wrote:
You could also just create a new class that references both your UI and
Business class. But if you already have methods in the Business class
calling methods in the UI class, then your sorta screwed. You really should
considered the benefits or migration to a more structured .NET version.
..NET does not lend itself to poor OOP implementations of VB6.

"djm" <dj*@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
I have a method in a "Business" Class that needs to call a method in a "UI"
Class
Currently, the "UI" Class calls methods in the "Business" Class...this I
can't change.

When I tried to add a reference to the "UI" in the "Business" project, I
got
an error saying I couldn't because of circular dependency...which I get.

I believe creating a public interface is probably my only option, but I'm
not exactly sure how to go about doing it. Any help or suggestions would
be
greatly appreciated.

Thx,
-- djm


Apr 10 '06 #7
djm
Security is not role based. It is based on access levels within the
application.
Depending on your access level, you may only be able to view certain screens
or fields in the UI...or you may have to provide your (non-windows) password
to be able to view or edit screens or fields.

I need to move on, so I'm going to leave the function in vb6 and call it via
xml until we can refactor our security model.

Thx for your help.

--
Thx,
-- djm
"Kevin Spencer" wrote:
Here's the problem.
I have methods in many different business layers that need security
clearance and I need the user to supplier their password.


How you handle this depends upon the type of security you're implementing.
Is it role-based, for example? In any case, the UI layer should be agnostic
of the user. All it should provide is the interface for the user to log in.
The business layer should handle the actual security. Remember, all the UI
layer is, is an interface for the user to interact with the business layer.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"djm" <dj*@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
Hi Kevin and Thx for the quick response.

I agree, but I'm involved in a project to convert a very big vb6
application
into .Net and the first phrase is to just convert and integrate the new
code
in to the application.

Here's the problem.
I have methods in many different business layers that need security
clearance and I need the user to supplier their password.

How can I accomplish this in n-tier architecture?

Thx,
-- djm
"Kevin Spencer" wrote:
A business class should never call any method in a UI class, first of
all.
The purpose of separating the layers is to enable other UIs to use the
Business class(es). The Business class(es) should know nothing about the
UI,
but only provide business functionality with regards to the data being
manipulated. The UI class may know anything about the publicly-exposed
members of the Business class(es).

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"djm" <dj*@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
>I have a method in a "Business" Class that needs to call a method in a
>"UI"
> Class
> Currently, the "UI" Class calls methods in the "Business" Class...this
> I
> can't change.
>
> When I tried to add a reference to the "UI" in the "Business" project,
> I
> got
> an error saying I couldn't because of circular dependency...which I
> get.
>
> I believe creating a public interface is probably my only option, but
> I'm
> not exactly sure how to go about doing it. Any help or suggestions
> would
> be
> greatly appreciated.
>
> Thx,
> -- djm


Apr 10 '06 #8

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

Similar topics

4
by: Evelyne | last post by:
On a server W2K, IIS5, I have many messages from ASP : cirdular dependency between types/modules. Which can be the origin of the problem? Example : Event Type: Warning Event Source: Active...
1
by: Mohit Gupta | last post by:
Hi all, I have just started working on VC++ .Net and have problem with circular dependencies of 2 files. I created 2 forms "Form1" and "Form2", which respectively created 2 .h files, Form1.h...
3
by: crichmon | last post by:
Any general advice for dealing with circular dependencies? For example, I have a situation which, when simplified, is similar to: ///////////// // A.h class A { public: int x;
2
by: ernesto basc?n pantoja | last post by:
Hi everybody: I'm implementing a general C++ framework and I have a basic question about circular dependencies: I am creating a base class Object, my Object class has a method defined as:...
4
by: Henke | last post by:
I have this scenario. public class A { public int numbers; public class A() { }
2
by: Rimma Meital via .NET 247 | last post by:
(Type your message here) -------------------------------- From: Rimma Meital I have 2 DLLs (Class Libraries). Both defines single-ton objects - logger object (writes to logger) and...
8
by: Jeff Connelly | last post by:
We're getting this error and don't know where to find the problem. I assume this is usually issued in the typical case where project A has a reference to project B, and project B has a reference...
7
by: barias | last post by:
Although circular dependencies are something developers should normally avoid, unfortunately they are very easy to create accidentally between classes in a VS project (i.e. circular compile-time...
3
by: donnyma | last post by:
I have a problem that looks like it has not been discussed before in these groups. I have a simple SQLAgent job that runs sp_who (could be anything, but let's just say sp_who for this example). ...
5
by: fomas87 | last post by:
Hi guys, I'm writing a framework for an sdl gui in c++, but got stuck on the circular dependency, I've read a lot of articles about resolving dependencies and about forward declaration but none of...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.