<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>OOP on Andy Foster</title><link>https://andyfoster.net/tags/oop/</link><description>Recent content in OOP on Andy Foster</description><generator>Hugo</generator><language>en-GB</language><lastBuildDate>Sun, 01 Oct 2023 10:12:00 +1200</lastBuildDate><atom:link href="https://andyfoster.net/tags/oop/index.xml" rel="self" type="application/rss+xml"/><item><title>UML Class Diagram</title><link>https://andyfoster.net/main-relationships-class-diagram/</link><pubDate>Sun, 01 Oct 2023 10:12:00 +1200</pubDate><guid>https://andyfoster.net/main-relationships-class-diagram/</guid><description>&lt;p&gt;Class diagrams are part of UML (Unified Modeling Language), which is a standardized graphical representation for specifying, visualizing, constructing, and documenting the artifacts of software systems. In class diagrams, various types of arrows are used to depict relationships between classes.&lt;/p&gt;&#10;&lt;p&gt;It&amp;rsquo;s kind of boring, business-like stuff, but it&amp;rsquo;s important to know the basics of UML class diagrams. They are used in many places, including design documents, code reviews, and technical interviews.&#10;Any complex system should probably be documented with UML diagrams, but for small projects, it&amp;rsquo;s usually enough to have a basic understanding of class diagrams.&lt;/p&gt;</description></item><item><title>Aggregation vs Composition in UML</title><link>https://andyfoster.net/aggregations-vs-composition/</link><pubDate>Tue, 12 Sep 2023 10:12:00 +0530</pubDate><guid>https://andyfoster.net/aggregations-vs-composition/</guid><description>&lt;p&gt;In object-oriented design and programming, the concepts of aggregation and composition are used to establish relationships between classes. These relationships are often depicted in UML (Unified Modeling Language) diagrams and implemented in programming languages like Java. Let&amp;rsquo;s delve into both concepts and see how they differ.&lt;/p&gt;&#10;&lt;h2 id="uml-representation"&gt;UML Representation &lt;a class="heading-anchor" href="#uml-representation" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Aggregation&lt;/strong&gt;: In UML, an aggregation relationship is depicted by a hollow diamond at the parent class end, pointing towards the child class.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Composition&lt;/strong&gt;: In UML, a composition relationship is depicted by a filled diamond at the parent class end, pointing towards the child class.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="java-representation"&gt;Java Representation &lt;a class="heading-anchor" href="#java-representation" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;In Java, both aggregation and composition can be implemented by using instance variables that refer to other objects.&lt;/p&gt;</description></item></channel></rss>