Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2008

Tip: Looking for answers? Try searching our database.

Functional issues of cyclic dependencies

Thread view: 
Jack - 05 Feb 2008 12:10 GMT
Hi,

i've read some articles on cyclic dependencies, that they are bad, very bad. But i can't find any real example of functionnal (!= design) issue with them.

Do you know any ?
Daniel Pitts - 05 Feb 2008 17:27 GMT
> Hi,
>
[quoted text clipped - 3 lines]
>
> Do you know any ?

Cyclic dependencies in runtime code isn't bad, but might be an
indication of highly coupled design if it is a static cyclic dependency.
 What articles have you read? A reference would be nice.

Signature

Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>

Jack - 06 Feb 2008 06:56 GMT
Daniel Pitts a écrit :
>> Hi,
>>
[quoted text clipped - 7 lines]
> indication of highly coupled design if it is a static cyclic dependency.
>  What articles have you read? A reference would be nice.

well, using google, i've read:

http://www.kirkk.com/blog/index.php?itemid=30
- avoiding cyclic dependencies at class/package level avoid them in jars

http://chasethedevil.blogspot.com/2006/10/how-jdepend-changed-my-java-packaging.html
- build system becomes overly complicated
- making jars is difficult

http://architecturerules.googlecode.com/svn/docs/cyclic-dependencies.html
Kevin McMurtrie - 06 Feb 2008 07:42 GMT
> Hi,
>
> i've read some articles on cyclic dependencies, that they are bad, very bad.
> But i can't find any real example of functionnal (!= design) issue with them.
>
> Do you know any ?

Why would it be a functional issue?  It's only a design issue in that
the complexity of maintenance can become unmanageable.  For a small
package that performs a specific task, cyclic dependencies may be a
perfectly elegant design.  When cycles go beyond the package scope, you
increase the risk of overlapping cyclic references prohibiting any
changes to the code (spaghetti code).

Signature

I don't read Google's spam.  Reply with another service.

Jack - 06 Feb 2008 08:22 GMT
Kevin McMurtrie a écrit :

>> Hi,
>>
[quoted text clipped - 9 lines]
> increase the risk of overlapping cyclic references prohibiting any
> changes to the code (spaghetti code).

That's the most persuasive point i've read.

But still, when i modify a method, i must check all the call sites. Whether the call sites are in the same package doesn't change the difficulty, from my experience.
Daniel Pitts - 06 Feb 2008 19:24 GMT
> Kevin McMurtrie a écrit :
>>
[quoted text clipped - 18 lines]
> Whether the call sites are in the same package doesn't change the
> difficulty, from my experience.

Right, but if you need to change class A, but it affects class B, which
affects class C, which in turn affects class A, whoops have to change B
again. It becomes difficult to effect change in cyclic dependencies.
Once you notice cyclic dependencies getting out of control, you can
easily decouple elements with an event system.

Signature

Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>

Patricia Shanahan - 09 Feb 2008 20:24 GMT
> Hi,
>
[quoted text clipped - 3 lines]
>
> Do you know any ?

In addition to the points that have already been made, it is easier to
unit test code without cyclic dependencies.

Any subtree, down to a leaf class that depends on nothing else, can be
tested as a unit, without it caring whether it is being used by one of
its normal callers or by a unit test.

Testing a class that depends on the classes that use it tends to require
more scaffolding.

Patricia


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.