<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gene Zeiniss</title>
    <description>The latest articles on DEV Community by Gene Zeiniss (@genezeiniss).</description>
    <link>https://dev.to/genezeiniss</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F554741%2F209b501b-bf35-46d7-99bc-410066068513.jpg</url>
      <title>DEV Community: Gene Zeiniss</title>
      <link>https://dev.to/genezeiniss</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/genezeiniss"/>
    <language>en</language>
    <item>
      <title>UML Diagrams: Sequence Diagram Overview</title>
      <dc:creator>Gene Zeiniss</dc:creator>
      <pubDate>Sat, 20 Feb 2021 09:56:24 +0000</pubDate>
      <link>https://dev.to/behalf/uml-diagrams-sequence-diagram-overview-31kp</link>
      <guid>https://dev.to/behalf/uml-diagrams-sequence-diagram-overview-31kp</guid>
      <description>&lt;h6&gt;
  
  
  This article was originally published on &lt;a href="https://medium.com/swlh/uml-sequence-diagram-through-the-little-prince-narrators-interactions-with-the-outside-world-98cb202448e4?source=friends_link&amp;amp;sk=5de265abfbd467a12cf4ca37f465765e" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;.
&lt;/h6&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/swlh/uml-sequence-diagram-through-the-little-prince-narrators-interactions-with-the-outside-world-98cb202448e4?source=friends_link&amp;amp;amp;sk=5de265abfbd467a12cf4ca37f465765e" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afill%3A88%3A88%2F1%2Av_y85oT8VmIrUpI6cherBg.jpeg" alt="Gene Zeiniss"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/swlh/uml-sequence-diagram-through-the-little-prince-narrators-interactions-with-the-outside-world-98cb202448e4?source=friends_link&amp;amp;amp;sk=5de265abfbd467a12cf4ca37f465765e" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Unveiling UML Sequence Diagrams Through “The Little Prince” | by Gene Zeiniss | The Startup&lt;/h2&gt;
      &lt;h3&gt;Gene Zeiniss ・ &lt;time&gt;Aug 8, 2024&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fmedium-f709f79cf29704f9f4c2a83f950b2964e95007a3e311b77f686915c71574fef2.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;The most used by me (and my favorite) UML diagram is Sequence Diagram. Implementation designs of each new feature I’m working on are loaded with Sequence diagrams. I mean it, totally chock-full.&lt;/p&gt;

&lt;p&gt;In general, a Sequence diagram describes how and in what order objects in our system interact with each other, arranged in time sequence. In this article, I’m about to show you the notations of these interactions through “The Little Prince” narrator’s interactions with the world around him. Have you read Antoine de Saint-Exupéry’s novel?&lt;/p&gt;

&lt;p&gt;I will summarise only the part that is relevant to the current article. It will be connected, I promise.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Okay, briefly, when he was a child, the Narrator read a book on jungles and was fascinated by the fact that a boa constructor swallows his prey whole and then sleeps for few months while digesting the meal. He drew a picture of the boa in this state.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F36xq7kuv3lbt0stnc65w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F36xq7kuv3lbt0stnc65w.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Here is a boa roentgen, if you have any doubts.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6etyt8e5hyakb5jjqx5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6etyt8e5hyakb5jjqx5w.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
When he showed it to adults, they all thought it was a lumpy hat and suggested he stop messing about and study the “important subjects” in school instead. The adults’ criticism killed the artist. The child grew up, became a pilot, and flew worldwide (not the worst). As an adult, he used the boa drawing to decide what topics to talk about with other adults. If an adult saw a lumpy hat, the Narrator spoke about golf and bridge and politics; he never mentioned jungles or boa constrictors or stars.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Now, back to the Sequence Diagram.&lt;/p&gt;

&lt;h1&gt;
  
  
  Sequence Diagram
&lt;/h1&gt;

&lt;p&gt;In my opinion, a sequence diagram is best to represent cross-services end-to-end scenarios or specific flow (or part of it) within a particular service. I’m creating this diagram before I start to design implementation, just to understand the requirements. It’s a contract between me and other involved guys, such as product manager, software architect, team members, etc. These diagrams are the VIP guests of each feature-related meeting.&lt;/p&gt;

&lt;p&gt;The sequence diagram depicts the objects involved in the scenario and the sequence of messages exchanged between them required to execute the functionality. It’s pretty cool and handy.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Let’s start with an overview of basic symbols:&lt;/p&gt;

&lt;h1&gt;
  
  
  Basic Symbols
&lt;/h1&gt;

&lt;p&gt;The sequence diagram has only two basic symbols: object and focus of control.&lt;/p&gt;

&lt;h3&gt;
  
  
  Object
&lt;/h3&gt;

&lt;p&gt;The Sequence diagram object is notated by a box with the name and &lt;strong&gt;dashed line extended down below&lt;/strong&gt;. While the object can represent a specific class (depending on what kind of logic you describe), I mostly use it to define a microservice.&lt;/p&gt;

&lt;p&gt;However, today, it will represent a Narrator.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkxkevzcg72k04ihk7vww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkxkevzcg72k04ihk7vww.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The dashed line is also known as the &lt;strong&gt;timeline&lt;/strong&gt;, shows the sequential events that occur to an object during the charted process. Note that time in a Sequence diagram is all about ordering. The timeline is not relevant for the duration of the interaction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Focus of Control
&lt;/h3&gt;

&lt;p&gt;The focus of control is the &lt;strong&gt;block that overlays the object’s timeline&lt;/strong&gt;. This is the time in which the object is actually being utilized.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpz6fcxjmr082d3lco1x7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpz6fcxjmr082d3lco1x7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Now we are jumping to the exciting part — the interaction between objects!&lt;/p&gt;

&lt;h1&gt;
  
  
  Interactions
&lt;/h1&gt;

&lt;p&gt;The objects in software systems can interact synchronously or asynchronously.&lt;/p&gt;

&lt;h3&gt;
  
  
  Synchronous Message
&lt;/h3&gt;

&lt;p&gt;Synchronous messaging is when the caller makes a call, expecting that object that’s being called to do some processing and return control back to the caller at some point in time.&lt;/p&gt;

&lt;p&gt;Back to our Narrator. Remember the bao drawing? He showed the drawing of bao to adults and actually waited to hear what they see:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F266fhp0t1p5hai6rrr21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F266fhp0t1p5hai6rrr21.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The synchronous message is notated by a &lt;strong&gt;solid line with a filled-in and enclosed arrow&lt;/strong&gt;, pointing from the caller (Narrator) to the callee (Adult). And you can see that it starts a new focus of control on the callee. &lt;/p&gt;

&lt;p&gt;Once the call that was made completes, control is returned back to the caller. This is represented by the return line, which is a &lt;strong&gt;dashed line with an open arrow&lt;/strong&gt; pointing to the caller.&lt;/p&gt;

&lt;p&gt;If you describe the flow between classes, I mean, the Narrator is calling to the Adult’s method, you can place the method name on the line. It’s also possible to put the passed parameters (depend on the level of details you are looking for).&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82io8y3genvyuvx35qnt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82io8y3genvyuvx35qnt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The return line can be identified with return values that are coming back to the caller. Again, according to the level of the details you decided on. It’s often common to not label the return line at all.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h6&gt;
  
  
  “Less is more” — Ludwig Mies van der Rohe
&lt;/h6&gt;
&lt;/blockquote&gt;

&lt;p&gt;In case, Narrator and Adult are services, the message can receive the endpoint name.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpb1d623g2obqun6co96.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpb1d623g2obqun6co96.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Here, you can see my return is pretty detailed. In my diagrams, I often return values that are relevant to the flow or to the contract.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h6&gt;
  
  
  “God is in the details” — Ludwig Mies van der Rohe
&lt;/h6&gt;
&lt;/blockquote&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Another special kind of message is self-massage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Self-Message
&lt;/h3&gt;

&lt;p&gt;The self-messaging, obviously, is a call that an object makes to itself. When an Adult is asked by a Narrator, the first calls his cognitive abilities to answer the question.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdktkh8tw5ragrn9pwwm4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdktkh8tw5ragrn9pwwm4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
In the case of self-message, you don’t need a return on it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Asynchronous Message
&lt;/h3&gt;

&lt;p&gt;The pretty of the asynchronous message is that the caller is not expecting the return message, so it’s not blocked.&lt;/p&gt;

&lt;p&gt;Imagine, that Narrator just said to Adult that he drew bao.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyc9ma2iwzwoavc8ub8rd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyc9ma2iwzwoavc8ub8rd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The async message is represented by a &lt;strong&gt;solid line with an open arrow&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;So, what we saw so far works great for basic simple flows. Although, we all know that the software we build includes many more operations and much more complexity.&lt;/p&gt;

&lt;p&gt;Let’s take a look, how we can model structural controls using Sequence Diagrams.&lt;/p&gt;

&lt;h1&gt;
  
  
  Structural Controls
&lt;/h1&gt;

&lt;p&gt;The first structural control I want to show you is Conditional control.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alternative (Conditional) Control
&lt;/h3&gt;

&lt;p&gt;The alternative is a choice (that is usually mutually exclusive) between message sequences. This is modeled by switch or if/else logic in our code:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbwpk8xwh92oofayadsc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbwpk8xwh92oofayadsc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The Narrator showed bao a drawing and asked, “what is it?”. If an adult saw a hat, the Narrator talked about golf; If an adult saw bao, he felt free to speak about boa constrictors.&lt;/p&gt;

&lt;p&gt;Alternative control is represented by a &lt;strong&gt;labeled rectangle shape with a dashed line inside&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Okay, to show you the controls, I will refresh the novel slightly more for you.&lt;/p&gt;

&lt;p&gt;The Narrator, who was a pilot (remember?), crashes in the Sahara desert. While he tries to repair his engine, a little boy (a Little Prince) appears out of nowhere and simply asks him to draw a sheep.&lt;/p&gt;

&lt;p&gt;Now, let’s talk about Parallel Control.&lt;/p&gt;

&lt;h3&gt;
  
  
  Parallel Control
&lt;/h3&gt;

&lt;p&gt;So, our Narrator is an extraordinary person (to put it mildly). However, to his credit, he is multitasking. He can (though with mixed success) repair the engine and communicate with a Little Prince in parallel. I must say, he is a genius!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzgwhh2a3fouztbr7mhlh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzgwhh2a3fouztbr7mhlh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
As you can see, Parallel control notation is pretty similar to the Alternative one. It is represented by a &lt;strong&gt;labeled rectangle with a dividing dashed line&lt;/strong&gt;. However, here each section must be processed, and processes should run in parallel.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Last but not least structural control is Looping.&lt;/p&gt;

&lt;h3&gt;
  
  
  Looping Control
&lt;/h3&gt;

&lt;p&gt;When Little Prince appeared in the story, he asked the Narrator to draw a sheep.&lt;br&gt;
&lt;a href="https://i.giphy.com/media/SgwPtMD47PV04/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/SgwPtMD47PV04/giphy.gif"&gt;&lt;/a&gt;&lt;br&gt;
Think about it for a moment. A little boy in a desert, alone… He’s not thirst or hunger. He wants a sheep. Fata-morgana? Genius Narrator stops the world and draws a sheep. So far, so good?&lt;/p&gt;

&lt;p&gt;As it turned out, the boy was very fussy. He asked to draw a sheep repeatedly (once it was too big, once too old). Until the Narrator pulled a box and told that the sheep is inside.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foj17rpo3f4pb7m79al9i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foj17rpo3f4pb7m79al9i.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The looping control shows that message interaction is going to happen multiple times. There is a guard text underneath the inverted tab that explains the loop.&lt;/p&gt;

&lt;p&gt;That’s all! 🐑&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;h6&gt;
  
  
  To look at some of the other UML diagrams I wrote about, head on over to &lt;a href="https://genezeiniss.medium.com" rel="noopener noreferrer"&gt;my profile&lt;/a&gt;.
&lt;/h6&gt;

</description>
      <category>programming</category>
      <category>design</category>
      <category>java</category>
    </item>
    <item>
      <title>UML Diagrams: Component Diagram Overview</title>
      <dc:creator>Gene Zeiniss</dc:creator>
      <pubDate>Wed, 06 Jan 2021 14:19:58 +0000</pubDate>
      <link>https://dev.to/behalf/uml-diagrams-component-diagram-overview-4hmh</link>
      <guid>https://dev.to/behalf/uml-diagrams-component-diagram-overview-4hmh</guid>
      <description>&lt;h6&gt;
  
  
  This article was originally published on &lt;a href="https://medium.com/nerd-for-tech/uml-diagrams-the-pizzeria-59a30af5fd6d?source=friends_link&amp;amp;sk=41e4168867c569d7d1b7414da3749916" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;.
&lt;/h6&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/nerd-for-tech/uml-diagrams-the-pizzeria-59a30af5fd6d?source=friends_link&amp;amp;amp;sk=41e4168867c569d7d1b7414da3749916" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afill%3A88%3A88%2F1%2Av_y85oT8VmIrUpI6cherBg.jpeg" alt="Gene Zeiniss"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/nerd-for-tech/uml-diagrams-the-pizzeria-59a30af5fd6d?source=friends_link&amp;amp;amp;sk=41e4168867c569d7d1b7414da3749916" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Unveiling UML Component Diagrams: A Pizza-Lover’s Guide | by Gene Zeiniss | The Startup&lt;/h2&gt;
      &lt;h3&gt;Gene Zeiniss ・ &lt;time&gt;Aug 8, 2024&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fmedium-f709f79cf29704f9f4c2a83f950b2964e95007a3e311b77f686915c71574fef2.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Think of pizza. The imagined smell of saucy, cheesy, spicy pizza baking in the oven is smashing me. Sometimes you want new toppings, other times, you want a different base. Many different ingredients create it. Each of these ingredients is separate components, but they interact and complement one another. They all exist within the greater system, in this case, the pizza.&lt;/p&gt;

&lt;p&gt;You got that straight. In this article, we will deal with UML’s Component Diagram.&lt;/p&gt;

&lt;h1&gt;
  
  
  Component Diagram
&lt;/h1&gt;

&lt;p&gt;Component diagrams are used to visualize how a system’s components interact (gee!) and what relationships they have among them. For the purpose of UML, the term “component” refers to a module of classes that represent independent systems with the ability to interface with the rest of the system. As we’re able to identify these interfaces, we’re able to find parts of the system that can be replaceable. In other words, we able to find plugin components.&lt;/p&gt;

&lt;p&gt;Finding plugin components allow us to reuse these components in other projects. It also helps us structure our work by dividing that work off to a few developers or independently running sub-teams.&lt;/p&gt;

&lt;p&gt;Back to the pizza, but now more specifically. Think about Hawaiian pizza on a restaurant menu. Probably, you will not find the pizza’s preparation and cooking methods. The menu just states the pizza ingredients, such as ham, pineapple, and bacon pieces over a red sauce (to be perfectly specific). By listing all of the ingredients, the customer can get a better idea of whether or not they’d enjoy the pizza. It is the same for the Component diagram. Unlike the other diagrams, the component ones are focused on high-level structure and not their methods and specific implementations. It’s a kind of a bird’s-eye view of your software system.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;When you are building a Component diagram, the first step is to identify the basic components used in the system.&lt;/p&gt;

&lt;h1&gt;
  
  
  Basic Component
&lt;/h1&gt;

&lt;p&gt;A component is a logical unit block of the system, a slightly higher abstraction than classes. It’s a subsystem if you wish. When subsystems are connected, it creates a single system.&lt;/p&gt;

&lt;p&gt;Let’s assume we want to create a small family Pizzeria system. Our basic components will be:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pizzaiolo — a professional pizza maker, as climbed by Oxford.&lt;/li&gt;
&lt;li&gt;Customer — the actual pizza’s consumer (pizza eater, the same one that possibly will enjoy Hawaiian pizza).&lt;/li&gt;
&lt;li&gt;Waiter — is &lt;a href="https://en.wikipedia.org/wiki/Homunculus_loxodontus" rel="noopener noreferrer"&gt;“The One Who Waits”&lt;/a&gt;. Never mind, I’m just playing associations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In UML, a component is represented as another box with this puzzle symbol in the top right-hand corner.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjq0rtxfs20scz1qnjlx5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjq0rtxfs20scz1qnjlx5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Here you can see the basic components of our Pizzeria. Cool? Not really. This information is not enough to tell us what we really need to know. Each component has a particular relationship to the other component through the interface it provides. The existence of these interfaces is the most interesting part.&lt;/p&gt;

&lt;p&gt;Let’s expand our diagram a little bit. We’ll add some adornments to our Customer component.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgb138xdya0lbji51j27w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgb138xdya0lbji51j27w.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Take a look at a diagram. I’ll start by talking about the Order and Payment. When a customer comes to the pizzeria, first, he should select and order the pizza. Right? The pizza party is usually finished by paying the bill. In Component language, Order and Payment are interfaces that our Customer provides (realizes or implements). The purpose of a provided interface is to show that a component offers an interface for others to interact with. This kind of interface is represented by a &lt;strong&gt;solid line with a lollipop&lt;/strong&gt; at the end and a name over it.&lt;/p&gt;

&lt;p&gt;Now, to provide the specific payment, the customer needs to know how much he needs to pay. The &lt;strong&gt;half-circle&lt;/strong&gt; (also called “&lt;strong&gt;socket&lt;/strong&gt;”) at the end of the connecting line represents the required interface. The meaning of it is that our honest customer expects to receive a check, provided by some other component (Waiter!) to be able to achieve its responsibilities.&lt;/p&gt;

&lt;p&gt;To summarize, the interface describes a group of operations used (required) or created (provided) by components.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Our basic components are defined. Next, identify all of the relevant libraries needed for your system.&lt;/p&gt;

&lt;h1&gt;
  
  
  Libraries and Third-Party Dependencies
&lt;/h1&gt;

&lt;p&gt;Component diagrams do not purely focus on what you implement. All third-party implementation dependencies must also be identified and integrated into the diagram where relevant. I will expand on third-parties later.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Finally, come up with the connections found between all these components. See how components can plug together. This is exactly the rationale behind this design.&lt;/p&gt;

&lt;h1&gt;
  
  
  Connections Between Components
&lt;/h1&gt;

&lt;p&gt;The components can be connected loosely or tightly, like a belt on trousers before (and after) eating pizza.&lt;/p&gt;

&lt;p&gt;Let’s start by talking about how we can loosely connect different components together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Loosely Connection
&lt;/h2&gt;

&lt;p&gt;It’s the main connection type of Content diagram. This is where we can define our pluggable parts of the system. When one component provided interface matches another component’s required interface, it’s called an &lt;strong&gt;assembly relationship&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbgew0126ti5fls6ov1mv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbgew0126ti5fls6ov1mv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Here you can see Customer and Waiter are connected like a puzzle. The components are plugging together. But you can also unplug them easily. The connection between them is loose. You can popup the Waiter service and replace it with something else, such as Shift Supervisor, or maybe the Pizzaiolo in the flesh will take the order. This is a replaceable piece of our system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tightly Connection
&lt;/h2&gt;

&lt;p&gt;The tight connection between components is represented by a &lt;strong&gt;solid line&lt;/strong&gt; between two components. It indicates that it’s not going to be so easy to replace one of these components. They are tightly coupled together. Let’s think of our example, assume that the customer can select pizza only from the pizza menu. His order is tightly dependent on the Menu component.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9c7k11yhbhxvpxr685zx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9c7k11yhbhxvpxr685zx.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
A Customer can not provide the order without a Menu. Getting rid of one of them will probably, require some rework for implementing this replacement.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;h1&gt;
  
  
  Basic Component Diagram
&lt;/h1&gt;

&lt;p&gt;Now, let’s take a look at a kind of a completed though rather small, Component diagram.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ft6znpgh5dykjzfjspnm9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ft6znpgh5dykjzfjspnm9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
You can see, the diagram has some new elements that we are not yet looked at. First of all, we have an outer component diagram here, called Pizzeria. It’s our whole system. The other components sitting inside of this box are parts that make up the Pizzeria. It consists of Pizzaiolo, Waiter, and Customer. The Customer is tightly connected to the pizzeria’s menu.&lt;/p&gt;

&lt;p&gt;A couple of other things to look at is the interaction with the outside world from the Pizzeria. Notice small squares sitting on the bounds of the Pizzeria component. These squares are called &lt;strong&gt;ports&lt;/strong&gt;, and they specify a separate interaction point between the component and the environment.&lt;/p&gt;

&lt;p&gt;In the Pizzeria example, ports represent the third-parties, such as a Cashier Service, used by Waiter; a Grocery Store, that provides the groceries required by Pizzaiolo; Pizzerias Ranking Service, which depend on review, provided by satisfied (or not) Customer.&lt;/p&gt;

&lt;p&gt;Since we don’t implement these services, it’s enough to show only the interaction point and the dependency direction (incoming or outgoing). Dependencies are represented by &lt;strong&gt;dashed lines&lt;/strong&gt; linking one component (or element) to another.&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;That’s all. Ciao ciao!&lt;/p&gt;

&lt;h6&gt;
  
  
  To look at some of the other UML diagrams I wrote about, head on over to &lt;a href="https://genezeiniss.medium.com" rel="noopener noreferrer"&gt;my profile&lt;/a&gt;.
&lt;/h6&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>design</category>
    </item>
    <item>
      <title>UML Diagrams: Class Diagram Overview</title>
      <dc:creator>Gene Zeiniss</dc:creator>
      <pubDate>Wed, 06 Jan 2021 14:01:47 +0000</pubDate>
      <link>https://dev.to/behalf/uml-diagrams-class-diagram-overview-5d16</link>
      <guid>https://dev.to/behalf/uml-diagrams-class-diagram-overview-5d16</guid>
      <description>&lt;h6&gt;
  
  
  This article was originally published on &lt;a href="https://medium.com/nerd-for-tech/uml-diagrams-the-common-tongue-f19366e5564?source=friends_link&amp;amp;sk=ece5a60f61eb134d994313c51cc09e95" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;.
&lt;/h6&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/nerd-for-tech/uml-diagrams-the-common-tongue-f19366e5564?source=friends_link&amp;amp;amp;sk=ece5a60f61eb134d994313c51cc09e95" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afill%3A88%3A88%2F1%2Av_y85oT8VmIrUpI6cherBg.jpeg" alt="Gene Zeiniss"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/nerd-for-tech/uml-diagrams-the-common-tongue-f19366e5564?source=friends_link&amp;amp;amp;sk=ece5a60f61eb134d994313c51cc09e95" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Decoding UML Diagrams: The Common Tongue of Software Modeling | by Gene Zeiniss | The Startup&lt;/h2&gt;
      &lt;h3&gt;Gene Zeiniss ・ &lt;time&gt;Aug 8, 2024&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fmedium-f709f79cf29704f9f4c2a83f950b2964e95007a3e311b77f686915c71574fef2.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;In my line of work, I’m often using UML diagrams. Daily, I daresay. Regardless, I never understood the subtlety of the diagram’s components. When to use a full arrow and when hollow, the line should be solid or dashed and which direction it should point. I’m done living in ignorance. So, here I am, about to start the UML diagrams series of articles.&lt;br&gt;
...&lt;/p&gt;

&lt;h1&gt;
  
  
  Briefly about UML
&lt;/h1&gt;

&lt;p&gt;UML (Unified Modeling Language) is a common software engineering modeling language that is used to solve a wide variety of problems. It’s a “the Common Tongue” of Westeros, for Game of Thrones fans. It helps you specify, visualize, and document models of software systems, including their structure and design, before coding (with an emphasis on “before”). As the old proverb says: “The carpenter measures twice and cuts once”.&lt;/p&gt;

&lt;p&gt;There are several types of UML diagrams and each one of them serves a different purpose. The two most broad categories that encompass all other types are Structural and Behavioral diagrams.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structural&lt;/strong&gt; (or Static) diagram visualizes the system’s static structure through objects, attributes, operations, and relationships. I have a cat, Lola. She has some stuff, such as a food bowl, claw sharpener, and the poop-house. So, the static aspects of Lola encompass the existence of her stuff. By the way, Lola herself will be described as an object (from an object-oriented view, right?).&lt;/p&gt;

&lt;p&gt;The Structural diagrams are: Class Diagram, Object Diagram, Component Diagram, Composite Structure Diagram, Package Diagram, Deployment Diagram, and Profile Diagram.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Behavioral&lt;/strong&gt; (or Dynamic) diagrams are used to visualize the dynamic aspects of a system. The Behavioral category includes a few general types of behavior, specifically the Use Case Diagram, Activity Diagram, and State Machine Diagram; and types that represent the different aspects of interaction (aka “Interaction Diagrams”) — Sequence Diagram, Communication Diagram, Timing Diagram, and Interaction Overview Diagram.&lt;br&gt;
In other words, it shows how the system interacts with external entities and users, how it responds to input or events, and what constraints it operates under. Just an example of an interaction between me and my cat. Lola hysterically meows. It triggers me to put food in her bowl. She eats while keeping the “thank hers”.&lt;/p&gt;

&lt;p&gt;Not all of the 14 different types of UML diagrams are used regularly when documenting systems and/or architectures. I’m about to write about the most useful diagrams, in my humble opinion, and will start the series with Class Diagrams.&lt;br&gt;
...&lt;/p&gt;

&lt;h1&gt;
  
  
  Class Diagram
&lt;/h1&gt;

&lt;p&gt;Since most software being created nowadays is still based on the object-oriented programming paradigm, using Class diagrams to document the software turns out to be a common-sense solution. A Class Diagram describes the structure of a system by showing it’s classes, their attributes, methods, and the relations between them. It’s a vocabulary of the system, a common language between all members of the team.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Structural features (attributes) define what objects of the class “know”. Cat knows her eye color, coat, weight range and is acutely aware of her superiority.&lt;/p&gt;

&lt;p&gt;Behavioral features (operations, aka methods) define what objects of the class “can do”. A cat can meow, eat, and poop (a very superficial idea of what a cat can do).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Classes are described as boxes in a Class Diagram. Each box has a title that represents the name of the class. Under the title, there are two sections:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The middle part of the box includes &lt;strong&gt;attributes&lt;/strong&gt;. An attribute notation is &lt;code&gt;attribute:type = defaultValue (optional)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The bottom part includes &lt;strong&gt;operations&lt;/strong&gt;. An operation notation is &lt;code&gt;operation(params):returnType&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Following notations allow to specify the visibility of a class member (i.e. any attribute or operation):&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F53umugp47xdrw9wdovgp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F53umugp47xdrw9wdovgp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
We are cool? This is a Cat Class example. Let’s take a look at what we have here:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7fr6wa4rpyx98hjr8lh6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7fr6wa4rpyx98hjr8lh6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Cat” is a class name (title).&lt;/li&gt;
&lt;li&gt;The Cat has some public attributes, such as “eyes color” of type enum with default value “Yellow” (let’s say), and value object “coat” of type Coat.&lt;/li&gt;
&lt;li&gt;Cats can meow and eat treats in public, however, they prefer to defecate in privacy (operations).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you create a class diagram, omit not required details. I mean, try to keep the diagram clean, by showing only relevant details. Class diagrams get cluttered really fast. Take a look at the middle part of the box, the displayed attributes are marked as public. It means that other classes have access to these parameters. As a notation, it saves me the need to indicate the obvious getters and setters we’d expect here. Verstehen?&lt;br&gt;
...&lt;/p&gt;

&lt;h1&gt;
  
  
  Relationships Between Classes
&lt;/h1&gt;

&lt;p&gt;A relationship is a general term covering the types of logical connections found on class and object diagrams. A class may be involved in one or more relationships with other classes or instances.&lt;br&gt;
...&lt;/p&gt;

&lt;p&gt;The class-level relationships cover the object-oriented paradigm key-factors: interface implementation (realization) and inheritance (generalization).&lt;/p&gt;

&lt;h2&gt;
  
  
  Realization (Interface implementation)
&lt;/h2&gt;

&lt;p&gt;In UML modeling, the realization is a relationship between two model elements, in which one model element (the client) implements the behavior that the other model element (the supplier) specifies.&lt;/p&gt;

&lt;p&gt;Now, the same stuff in human language. The Cat is a domestic species of the Felidae family. I could say, Cat is a realization of Felidae. Or, in an object-oriented language, Cat is a specific implementation of the Felidae interface.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxu2gp2lptwggzqzzgq1p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxu2gp2lptwggzqzzgq1p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Note that the interface box has only one part under the title, which includes the operations, which have various implementations.&lt;/p&gt;

&lt;p&gt;Class “Cat” implements the “Felidae” interface. We can recognize it by the connecting line between their boxes. The &lt;strong&gt;dashed line&lt;/strong&gt; with a &lt;strong&gt;hollow arrow pointing back&lt;/strong&gt; to the interface that’s being implemented.&lt;/p&gt;

&lt;p&gt;Notice that in the Cat box, we are not showing any operations that are part of “Felidae”. Cat implements these operations, no need to duplicate them (keep diagrams as clean as possible, remember?).&lt;/p&gt;

&lt;h2&gt;
  
  
  Generalization (Inheritance)
&lt;/h2&gt;

&lt;p&gt;Generalization represents a “IS A’’ relationship between a general class (Cat) and a more specific implementation of this class (Cat Breed). Russian Blue is a cat breed, while each specific cat breed acquires all the attributes and operations of a Cat, but also can have it’s own. For, example, cats of the Scottish Fold breed can &lt;a href="https://www.lovemeow.com/kitten-that-stands-on-his-feet-1608002364.html" rel="noopener noreferrer"&gt;stand up on their hind legs&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqtt5jkfuf5q2w3t5vtz7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqtt5jkfuf5q2w3t5vtz7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The generalization relationship notated in UML by a &lt;strong&gt;solid line&lt;/strong&gt; with an &lt;strong&gt;enclosed hollow arrow, pointing back&lt;/strong&gt; to the general (base) class.&lt;/p&gt;

&lt;p&gt;Another couple of items to keep in mind here is the concept of Abstract and Concrete Classes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An abstract class is a class that we will never instantiate. In UML, this class’s name should be italicized.&lt;/p&gt;

&lt;p&gt;A concrete class is a class that we actually instantiate. It’s a default class, without any special decorations of its title.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;...&lt;br&gt;
The next thing we want to look at in our Class Diagram is modeling relationships.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Relationship (Association)
&lt;/h2&gt;

&lt;p&gt;This association relationship is usually described as a “HAS A” relationship. It indicates that at least one of two related classes refers to each other. This relationship is represented simply by a &lt;strong&gt;solid line&lt;/strong&gt; (without an arrow) that connects two classes.&lt;/p&gt;

&lt;p&gt;Now, often, it’s important to understand how many items on each side of a relationship can exist, which we call “cardinality”. The cardinality is expressed in terms of: “one to one”, “one to many” and “many to many”. In UML it’s notated as follows:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fly5cg9dtrpq9j8xr9yeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fly5cg9dtrpq9j8xr9yeg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Take a look at this diagram:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2b894rkjehie4qpkv2tz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2b894rkjehie4qpkv2tz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
In the current example, a cat has a human (the chosen one, right). The human has few cats (of both Russian Blue (wannabe) and Scottish Fold breeds. True story). It’s a “many to one” relationship.&lt;/p&gt;

&lt;h2&gt;
  
  
  Aggregation Relationship
&lt;/h2&gt;

&lt;p&gt;Aggregation is a variant of the “HAS A” relationship, however, it’s more specific than an association. Aggregation represents a one-way association, called a “PART-WHOLE” relationship. I mean, one entity works as an owner (a whole) of another (a part of the whole), but the owned classes do not have a strong lifecycle dependency on the owner.&lt;/p&gt;

&lt;p&gt;Back to our Cat. Each cat must have a poop-house. So, the implied relationship between “Cat” and “Poop-House” will be a “HAS A” type relationship. But the reverse may not be true. Each poop-house doesn’t need to be contained by any cat. Now it easy to recognize that Cat is an owner entity and this is an aggregation relationship.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8hnltx4zywl1z8nnmu0x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8hnltx4zywl1z8nnmu0x.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
In UML, the connecting line has a &lt;strong&gt;hollow diamond, pointing to the owner class&lt;/strong&gt;. Poop-House is strongly related to the Cat.&lt;/p&gt;

&lt;h2&gt;
  
  
  Composition Relationship
&lt;/h2&gt;

&lt;p&gt;The composition is a “PART OF” relationship, a special type of aggregation, where parts don’t stand on their own so much. The owner class here is a kind of container, and related entities are its contents. All entities are interdependent of each other for example “litter box and clumping litter is part of poop-house”. The house can not exist without the box or the litter, doesn’t it?&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fll92ut9jhynwrr82rnbs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fll92ut9jhynwrr82rnbs.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Here we have a &lt;strong&gt;solid line with a filled diamond, pointing to the owner class&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Uses Relationship (Dependency)
&lt;/h2&gt;

&lt;p&gt;Uses relationship is a little bit softer tied between the classes. This relationship indicates that one class depends on another because it uses it at some point in time.&lt;/p&gt;

&lt;p&gt;For example, other family members can communicate with the Cat and the Human (that is not welcomed much by the Cat).&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbegapg50kzjjvbm1edvb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbegapg50kzjjvbm1edvb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Uses relationship notation is a &lt;strong&gt;dashed line with an open arrow, pointing to the used classes&lt;/strong&gt;. It helps us to understand that changes in Cat or Human can affect Other Family Members, and so we should be careful. We’re good?&lt;br&gt;
...&lt;br&gt;
We are done. Now, let’s check the completed overall view of the basic Class Diagram.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fak0wza4vurgkoh1158g8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fak0wza4vurgkoh1158g8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
That’s all.&lt;/p&gt;

&lt;h6&gt;
  
  
  To look at some of the other UML diagrams I wrote about, head on over to &lt;a href="https://genezeiniss.medium.com" rel="noopener noreferrer"&gt;my profile&lt;/a&gt;.
&lt;/h6&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>design</category>
    </item>
  </channel>
</rss>
