Talk:Circular dependency

From Wikipedia, the free encyclopedia

What is the point of this article? Are circular dependencies acceptable or are they to be avoided ?(the article implies "unavoidable"). Do such dependencies only exist between two classes or can the cycles be larger (e.g., A->B->C->D->A) (the article implies "two"). Do such dependencies only exist in C++ or do they appear in other OO languages? (the article implies c++ is what's important). Yes it's "only" a stub. But without knowing what the intent of having the article is in the first place, it's hard to know how to complete it (or whether it is even worth bothering).

I've now improved the article to answer (most of) your questions. Hope it's clearer now. --Fredrik Orderud 13:33, 29 January 2006 (UTC)
Who is considering circular dependencies bad practice, and why? I think it's just plain nonsense, especially for types that are part of the same subsystem (so I can't have a Company with a list of Persons, and a Person with a backreference to the Company to which it belongs?).
Also, you say that you need to include the definition of one class above the other, which you already show is not true. You need the declaration, not the definition. Forward declaration is not a "trick". If you need to use a forward declaration because you're having a circular dependency, you are including too much header files in the first place. You should only include what you need, and declaring a pointer doesn't mean you need the definition of the class pointed to. Including too much and increasing file dependencies and compile times, now THAT is considered bad practice :). With all that in mind, basically the whole paragraph becomes ridiculous, and I seriously doubt the usefulness of this article as a whole --.oisyn 10:51, 8 November 2007 (UTC)

[edit] C++

This article implies that there is a circular dependency between C++ and circular dependencies when in fact there are no dependencies between C++ and circular dependencies as all. Specifically the article seems to imply that C++ depends on circular dependencies and that circular dependencies depend on C++. I can assure you, however, that C++ does not depend on circular dependencies, and in fact, limited C++ code can be written with no dependencies at all or even with non-circular dependencies. Likewise, circular dependencies do not depend on C++, but can in fact, exist in programs written in other languages (as a PHP developer I can prove this).