#UML — Understanding Lollipops and Sockets in UML: A Clear Explanation

I was trying to look up what the open ring and ball symbols in UML diagrams represent, but I found scattered and unsatisfying answers across the internet. Finally, I stumbled upon a StackOverflow post, but even then, the explanations didn’t fully satis…


This content originally appeared on DEV Community and was authored by Nuri Ensing

I was trying to look up what the open ring and ball symbols in UML diagrams represent, but I found scattered and unsatisfying answers across the internet. Finally, I stumbled upon a StackOverflow post, but even then, the explanations didn’t fully satisfy me. So, I decided to post my own answer on StackOverflow: https://stackoverflow.com/questions/8307724/using-lollipops-sockets-in-uml-why-and-when/78941132#78941132

Since my posts often serve as notes for myself and the wider world, I decided to expand on the topic here.

Lollipops and Sockets in UML 2

In UML 2, you have the following symbols:

Lollipop: A small circle connected to a line: o----
Socket: An open ring with a line: ---(

Lollipops and sockets are used in UML to give a big-picture view when you want to show how different parts of your system connect and work together without diving into too much detail. They’re mostly used in component diagrams, where a component represents a module or subsystem that functions independently but can interface with the rest of the system.

How It Works

To keep things simple, if you see a block with a line ending in an open ring, that block needs to get information or services from somewhere else in order to do its job. So, it is dependent on something, and that “something” will be represented by another block with a lollipop (a small circle). These blocks are then connected to each other to perform the complete function.

Example

Image description

Consider an Authentication Service component that provides user authentication services, such as verifying usernames and passwords. Another component, like a website — for example, stackoverflow.com (represented as a block with a socket) — needs to verify user credentials before granting access to user accounts.

  • The Authentication Service component (on the left) is represented with a lollipop symbol, indicating that it provides the authentication service.

  • The Stackoverflow.com component (on the right) is represented with a socket symbol, showing that it requires the authentication service to verify user credentials before granting access.


This content originally appeared on DEV Community and was authored by Nuri Ensing


Print Share Comment Cite Upload Translate Updates
APA

Nuri Ensing | Sciencx (2024-09-02T15:17:50+00:00) #UML — Understanding Lollipops and Sockets in UML: A Clear Explanation. Retrieved from https://www.scien.cx/2024/09/02/uml-understanding-lollipops-and-sockets-in-uml-a-clear-explanation/

MLA
" » #UML — Understanding Lollipops and Sockets in UML: A Clear Explanation." Nuri Ensing | Sciencx - Monday September 2, 2024, https://www.scien.cx/2024/09/02/uml-understanding-lollipops-and-sockets-in-uml-a-clear-explanation/
HARVARD
Nuri Ensing | Sciencx Monday September 2, 2024 » #UML — Understanding Lollipops and Sockets in UML: A Clear Explanation., viewed ,<https://www.scien.cx/2024/09/02/uml-understanding-lollipops-and-sockets-in-uml-a-clear-explanation/>
VANCOUVER
Nuri Ensing | Sciencx - » #UML — Understanding Lollipops and Sockets in UML: A Clear Explanation. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/02/uml-understanding-lollipops-and-sockets-in-uml-a-clear-explanation/
CHICAGO
" » #UML — Understanding Lollipops and Sockets in UML: A Clear Explanation." Nuri Ensing | Sciencx - Accessed . https://www.scien.cx/2024/09/02/uml-understanding-lollipops-and-sockets-in-uml-a-clear-explanation/
IEEE
" » #UML — Understanding Lollipops and Sockets in UML: A Clear Explanation." Nuri Ensing | Sciencx [Online]. Available: https://www.scien.cx/2024/09/02/uml-understanding-lollipops-and-sockets-in-uml-a-clear-explanation/. [Accessed: ]
rf:citation
» #UML — Understanding Lollipops and Sockets in UML: A Clear Explanation | Nuri Ensing | Sciencx | https://www.scien.cx/2024/09/02/uml-understanding-lollipops-and-sockets-in-uml-a-clear-explanation/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.