Announcement Announcement Module
Collapse
No announcement yet.
Cyclic dependency for Services Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cyclic dependency for Services

    I am converting my legacy code to suit into a service based architecture , and i am porting it to spring DM.

    Since i can not make all changes in a single release we are taking it part by part.In the process i am having service cyclic dependencies.

    For example:

    Bundle A - depends on BUndle B's service

    Bundle B - depends on bundle A's service

    The interfaces for both the services are in seperae bundle X and also i have marked both the services as optional(cardinality 0:1).

    Is it a bad practise ?

  • #2
    Any kind of cyclic dependencies between bundles is not best practice. Some of the downsides are that you cannot reuse either bundle without the other and if you make a change in either bundle, you need to re-test them both.

    The alternative of bundles with acyclic dependencies has the advantages of a layered architecture.

    A downside of using an optional dependency for something that really is mandatory is that, if it the dependency is not satisfied, then you won't get the ideal failure behaviour.

    But if you are converting legacy code, it is often necessary to make these kinds of compromises in the short term and clean up later.

    Comment


    • #3
      Thanks Gyln :-)

      In the long run we plan to remove all these cyclic dependencies. Since we are converting this legacy code step by step, we are forced to make some compromises.

      Comment

      Working...
      X