in reply to So much interconnectedness - good or bad?

Is such interconnectedness bad?
Yes.
Is it a particular feature of procedural perl and not OO perl?
No, circular dependencies are not dependent on style.
Or is it just bad design by the programmer?
Yes, it is just bad design by the programmer.
  • Comment on Re: So much interconnectedness - good or bad?

Replies are listed 'Best First'.
Re^2: So much interconnectedness - good or bad?
by stvn (Monsignor) on Dec 17, 2004 at 04:10 UTC
    Yes, it is just bad design by the programmer.

    Okay, i will agree that from the short desciption of the design it does not sound like it is very good. But interconnectness and circular dependencies are not always bad design, sometimes they are a fact of life. A, B, C, & D are not very descriptive, but take something like Car, Engine, Tires, Brakes & Steering. They are all tightly interconnected, and require intimate knowledge of each other. Good design also means knowing when to break the "rules" too.

    -stvn
      take something like Car, Engine, Tires, Brakes & Steering

      If your "Tires" module requires something from any of those other modules, you've got the wrong design for "Tires"; likewise for Engine, Brakes and Steering. Obviously, a "Car" object needs instances of the other four objects, but there is a limit to how "intimate" the Car should be regarding the internals of the others. Really good design means knowing how to maintain a modicum of simplicity, both in the individual pieces and in how they are assembled.

        Tyres may not appear to know much about the car at first but dig a little deeper. The tyres will have a speed rating and contact area that is designed to match the power of the engine, a pressure setting and characteristics that interact with the suspension setup, a compound that will provide reasonable ballance between grip and wear in that application. Although all these are hard coded into the tyres on your car/bike/tractor/aircraft the knowlege had better be there somewhere

        I guess we could better have a tyre factory ;) that interacts with car/plane/bike/suppermarket trolley to churn out the tyre that does the job and a car that provides its characteristics to the tyre factory (or even a car factory that....)

        Cheers,
        R.