Results 1 to 3 of 3

Thread: Cyclic dependency for Services

  1. #1
    Join Date
    Nov 2008
    Location
    London,UK
    Posts
    299

    Default 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. #2
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    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.
    Glyn Normington
    SpringSource

  3. #3
    Join Date
    Nov 2008
    Location
    London,UK
    Posts
    299

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •