Loading ...
Sorry, an error occurred while loading the content.

9084Re: "ocaml_beginners"::[] Circular dependencies between modules

Expand Messages
  • Fabrice Marchant
    Dec 1, 2007
    • 0 Attachment
      Thanks for your answer,

      > > > - Jon : Having big cyclic dependencies is a bad idea anyway...
      > > Ah ! I wondered whether the need of such cyclic dependency didn't reveal some misconception.
      > Jon's right. It'd be interesting to know what code you think needs
      > circular dependencies.
      There is a "viewer" file module in this project : it is a movable an "zoomable" window on a universe computed by another file
      module called "automaton". This automaton is responsible of any modification of the universe. Another file module "controller" allow the user to control the automaton actions and the parameters of the viewer.
      Due to their relative dependencies, the file modules ( among others ) appear in this order :
      automaton.ml viewer.ml controller.ml
      Up to now, no problem.

      But here comes a trial to add a new possibility :
      The user can decide via the controller to restrict existing universe, cutting it to objects that belong to the current visible view.
      This request must be sent to the automaton - that now needs information about the zone of the universe that is currently viewed.
      But the automaton cannot access to the viewer internals.

      As in Jon's method, it would be possible to do the job with a module that depends on automaton and viewer : for example the controller. However this controller wasn't intended to access such kind of data and I would feel odd to add another module that would retrieve info from viewer to give them to the automaton.
      I would prefer that the automaton simply fetch what it needs inside the viewer.

      > I've rarely come across any, and each time it
      > turned out to be my faulty thinking.
      It's up to you to say whether if this above case is completely faulty or if it has a chance to fall in RĂ©mi Vanicat possible "way to go".


    • Show all 15 messages in this topic