-2

I would like to use UML diagrams to show some processes I am designing and would like to implement.

The processes involve using a queue, and adding and taking out elements from it.

  • In one of this process the adding and taking out elements are done by two different threads.

  • In the other, both operations are done by the same thread.

So far I have used sequence diagrams to represent the process involving multithreads, but these diagrams don't have the level of granularity to show the queues processing,

Which is the best way to represent this with UML?

  • 1
    Sharing your research helps everyone. Tell us what you've tried and why it didn't meet your needs. This demonstrates that you've taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask – gnat Apr 29 at 9:41
  • So far I have used sequence diagrams to represent the process involving multithreads, but these diagrams don't have the level of granularity to show the queues processing, that is why I asked – KansaiRobot Apr 29 at 9:49
  • @KansaiRobot: don't bury any additional information in a comment section., Instead, use the "edit" button to improve your question. And did you notice: you can post images like sequence diagrams there as well. – Doc Brown Apr 29 at 10:49
  • @KansaiRobot I’ve edited the question to include your important comment. Questions on SE should be self-contained because many people here read just the question, decide whether it’s ok or not, and vote. Comments are often read only when there is an interest in the subject. – Christophe May 1 at 8:38
  • Within a big project, we came to the solution NOT using UML for this but using BPMN with lanes etc... Just as an idea, if this helps. – Walter Kuhn May 1 at 9:36
2

Your modelling requirement strongly suggest to use UML activity diagrams:

  • they allow to represent processes
  • they can represent concurrency through fork and join nodes
  • they can show object flows within the processes
  • they provide for a central buffer for queuing data in addition to the queuing possibility of every activity involved in objet flow
  • they even provide for event-driven processing of objects, when accept-event actions are combined with object flows and "pins".

Other behavioral UML diagrams come to mind as well for representing processes. You may consider for example:

  • a sequence diagram. But these are more appropriate to represent interaction scenarios between classes. They are less precise about complex synchronisation and less expressive for mixing control flow and object flows.
  • a state machine diagram. These provide for forks and joins. But it's a different viewpoint. They are more appropriate for describing the dynamic of change of system or a component state rather than a process.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.