Results 1 to 4 of 4
  1. #1
    java_new is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default Question on dependency execution

    Hi,
    I'm completely new to java. I'm trying the tackle this following scenario. For e.g. I've a list of “Tasks” and their dependencies. E.g. Task D depends on (Task A and Task B) , Task A depends on Task B, Task B depends on Task C.
    I'm trying to write a program to print out the sequence of these tasks (For example, using the case above, it should be C, B, A, D).
    1. What is the best way to approach this ?
    2. What possible ways I can test this design?
    3. How can I make sure that there's no circular dependency?
    Any pointers will be highly appreciated.
    -Thanks

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    More likely you can handle the situation by defining several methods. You have to define what's the order to execute them according to the requirment.

  3. #3
    java_new is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default

    Thanks for ur reply...I was looking into the digraphs algorithm to see if that can be a possible solution

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,785
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by java_new View Post
    Thanks for ur reply...I was looking into the digraphs algorithm to see if that can be a possible solution
    Your problem is a Program Evaluation and Review Technique (PERT) problem wich is part of the CPM (Critical Path Method). Once you get the idea it's easy to solve.

    kind regards,

    Jos

Similar Threads

  1. Dependency and exclusion
    By Abder-Rahman in forum XML
    Replies: 0
    Last Post: 09-18-2009, 06:09 PM
  2. Maven Dependency Overview 1.1
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 07-02-2008, 08:13 PM
  3. Maven Dependency Overview 1.0
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-15-2008, 07:52 PM
  4. What are dependency injection and its advantages
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 09-26-2007, 09:27 PM
  5. Dependency Analyzer 1.0.3-rc0
    By levent in forum Java Software
    Replies: 0
    Last Post: 07-30-2007, 05:34 PM

Posting Permissions

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