{"id":1138,"date":"2023-09-12T13:25:33","date_gmt":"2023-09-12T11:25:33","guid":{"rendered":"http:\/\/oopm.org\/?page_id=1138"},"modified":"2025-01-15T10:45:20","modified_gmt":"2025-01-15T09:45:20","slug":"5-3-representing-classification-hierarchies","status":"publish","type":"page","link":"https:\/\/oopm.org\/?page_id=1138","title":{"rendered":"8.6 Representing classification hierarchies"},"content":{"rendered":"<div class=\"pdfprnt-buttons pdfprnt-buttons-page pdfprnt-top-right\"><a href=\"https:\/\/oopm.org\/index.php?rest_route=wpv2pages1138&print=pdf\" class=\"pdfprnt-button pdfprnt-button-pdf\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/oopm.org\/wp-content\/plugins\/pdf-print\/images\/pdf.png\" alt=\"image_pdf\" title=\"View PDF\" \/><\/a><a href=\"https:\/\/oopm.org\/index.php?rest_route=wpv2pages1138&print=print\" class=\"pdfprnt-button pdfprnt-button-print\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/oopm.org\/wp-content\/plugins\/pdf-print\/images\/print.png\" alt=\"image_print\" title=\"Print Content\" \/><\/a><\/div>\n<p class=\"wp-block-paragraph\"><em>Classification<\/em> is a fundamental means for understanding and organizing knowledge about the real world, and is used in many disciplines like biology, physics, health, etc. Classification is a means for organising concepts in a hierarchy called a <em>classification hierarchy.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Class <code>Account<\/code> and the subclasses <code>SavingsAccount<\/code> and <code>CreditAccount<\/code> and class <code>Booking<\/code> and its subclasses <code>TravelBooking<\/code>, <code>FlightBooking<\/code>, <code>TrainBooking<\/code> and <code>HotelBooking<\/code> are examples representing classification hierarchies.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column has-white-background-color has-background is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:40%\">\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/oopm.org\/wp-content\/uploads\/2024\/11\/tempImageoue7yo.heic\" alt=\"\" class=\"wp-image-9651\" style=\"width:381px;height:auto\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column has-white-background-color has-background is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/oopm.org\/wp-content\/uploads\/2024\/11\/tempImagerYyR8X.heic\" alt=\"\" class=\"wp-image-9653\" style=\"width:327px;height:auto\"\/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-media-text has-media-on-the-right is-stacked-on-mobile\" style=\"grid-template-columns:auto 38%\"><div class=\"wp-block-media-text__content\">\n<p class=\"wp-block-paragraph\">We use classification in our everyday language when we deal with various types of concepts. We use general terms like animal, and more specific terms like mammal, fish, bird, and insects. We may use terms like dog and cat to be more specific than just mammal. Even though dogs like golden retriever, puddle, and greyhound are breeds of dogs, one may also put these into such a classification. The figure to the right shows a partial animal classification hierarchy.<\/p>\n<\/div><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"481\" height=\"462\" src=\"https:\/\/oopm.org\/wp-content\/uploads\/2024\/10\/AnimalHierarchy-5.jpg\" alt=\"\" class=\"wp-image-9007 size-full\" srcset=\"https:\/\/oopm.org\/wp-content\/uploads\/2024\/10\/AnimalHierarchy-5.jpg 481w, https:\/\/oopm.org\/wp-content\/uploads\/2024\/10\/AnimalHierarchy-5-300x288.jpg 300w\" sizes=\"(max-width: 481px) 100vw, 481px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The terms&nbsp;<em>generalization<\/em>&nbsp;and&nbsp;<em>specialization<\/em>&nbsp;are often associated with classification hierarchies. A&nbsp;<em>generalization<\/em>&nbsp;is a more general concept that captures the commonalities of and suppresses some of the differences of a number of more special concepts. A <em>specialization<\/em> is the inverse of a generalization. In&nbsp;the above figure,&nbsp;<code>Account<\/code>&nbsp;is a generalization of&nbsp;<code>SavingsAccount<\/code>&nbsp;and <code>CreditAccount<\/code>,&nbsp;&nbsp;and these are specializations of&nbsp;<code>Account<\/code>.&nbsp;<code>Booking<\/code> is a generalisation of <code>TravelBooking<\/code>, and <code>HotelBooking<\/code>, and <code>FlightBooking<\/code>, and <code>TrainBooking<\/code> are specializations of <code>TravelBooking<\/code>, etc.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:40%\">\n<p class=\"wp-block-paragraph\">The vehicle hierarchy is another example of a classification hierarchy. The need for being able to represent such a hierarchy of vehicles lead the designers of SIMULA, Ole-Johan Dahl and Kristen Nygaard to invent the subclass mechanism of SIMULA.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" width=\"418\" height=\"306\" src=\"https:\/\/oopm.org\/wp-content\/uploads\/2025\/01\/CarTruckBusSimula.jpg\" alt=\"\" class=\"wp-image-11168\" style=\"width:316px;height:auto\" srcset=\"https:\/\/oopm.org\/wp-content\/uploads\/2025\/01\/CarTruckBusSimula.jpg 418w, https:\/\/oopm.org\/wp-content\/uploads\/2025\/01\/CarTruckBusSimula-300x220.jpg 300w\" sizes=\"(max-width: 418px) 100vw, 418px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">In section <script>mkRef(\"Representing concepts\")<\/script>, we introduced the notions of extension, intension and designation of a concept. For a concept and its specializations, the following properties hold:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The extension of a specialized concept is a&nbsp;<em>subset<\/em>&nbsp;of the extension of the corresponding generalized concept.<\/li>\n\n\n\n<li>The intension of a specialized concept&nbsp;<em>extends<\/em>&nbsp;the intension of the corresponding generalized concept by adding additional properties<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">With respect to (1), all phenomena covered by a specialised concept are also phenomena belonging to the more general concept. All saving accounts are accounts, all flight bookings are booking, and all dogs are animals.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With respect to (2), a general concept is characterised by a number of properties. Specializations of a concept have further properties in addition to this of their generalisation. The properties of a booking are also properties of a flight booking, etc. The properties of a dog are also properties og a cocker spaniel, etc.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>Extension of a superclass<\/em>.<br>As said in section <script>mkRef(\"Representing concepts\")<\/script>, the extension of a class is all objects generated from the class. The extension of a class also includes all objects generated from subclasses of the class.<\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The extension of <code>SavingsAccount<\/code> is all objects generated from class <code>SavingsAccount<\/code>.<\/li>\n\n\n\n<li>The extension of <code>CreditAccount<\/code> is all objects generated from class <code>CreditAccount<\/code>.<\/li>\n\n\n\n<li>The extension of <code>Account<\/code> is all objects generated from class<code> Account<\/code> and it includes the extensions of <code>SavingsAccount<\/code> and <code>CreditAccount<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The relationships between the extensions of the <code>Account<\/code> classes are illustrated by the figure below:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" width=\"682\" height=\"708\" src=\"https:\/\/oopm.org\/wp-content\/uploads\/2024\/12\/Extensions.jpg\" alt=\"\" class=\"wp-image-10436\" style=\"width:503px;height:auto\" srcset=\"https:\/\/oopm.org\/wp-content\/uploads\/2024\/12\/Extensions.jpg 682w, https:\/\/oopm.org\/wp-content\/uploads\/2024\/12\/Extensions-289x300.jpg 289w\" sizes=\"(max-width: 682px) 100vw, 682px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The term <em>subclass<\/em> was used in SIMULA and refers to the fact that the extension of a subclass is a subset of the extension of the superclass. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For C++, Bjarne Stroustrup found the terms subclass and superclass to be confusing and he thus introduced the terms <em>base class<\/em> and <em>derived class <\/em>where derived class corresponds to subclass and base class to superclass. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some languages, like Java, use the term <em>extend<\/em> to define a subclass\/derived class &#8211; extend refers to the fact that the intension of the superclass is extended.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The class\/subclass mechanism as presented here can only be used to represent <em>tree-structured classification hierarchies<\/em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-custom-color-3-color\"> <\/mark>also referred to as <em>single inheritance<\/em>. In a tree-structured classification hierarchy a concept has at most only one direct super generalisation and an arbitrary number of specialization<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-custom-color-3-color\">. <\/mark>When represented by classes this means that a class has at most only one direct superclass and an arbitrary number of subclasses.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are domains where there is a need for representing non-tree-structured classification hierarchies where a concept\/class may have more than one generalization\/superclass. We return to this in chapter <script>mkRef(\"Aspects\")<\/script> on aspects and in chapter<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-custom-color-3-color\">  <script>mkRef(\"Non-tree-structured classification hierarchies\"); <\/script><\/mark>.<\/p>\n<div style=\"display:flex; gap:10px;justify-content:center\" class=\"wps-pgfw-pdf-generate-icon__wrapper-frontend\">\n\t\t<a  href=\"https:\/\/oopm.org?action=genpdf&amp;id=1138\" class=\"pgfw-single-pdf-download-button\" ><img src=\"https:\/\/oopm.org\/wp-content\/plugins\/pdf-generator-for-wp\/admin\/src\/images\/PDF_Tray.svg\" title=\"Generate PDF\" style=\"width:auto; height:45px;\"><\/a>\n\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Classification is a fundamental means for understanding and organizing knowledge about the real world, and is used in many disciplines like biology, physics, health, etc. Classification is a means for organising concepts in a hierarchy called a classification hierarchy. Class Account and the subclasses SavingsAccount and CreditAccount and class Booking and its subclasses TravelBooking, FlightBooking, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1008,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1138","page","type-page","status-publish","hentry"],"mb":[],"mfb_rest_fields":["title","gutenberg_elementor_mode"],"_links":{"self":[{"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages\/1138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oopm.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1138"}],"version-history":[{"count":66,"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages\/1138\/revisions"}],"predecessor-version":[{"id":11169,"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages\/1138\/revisions\/11169"}],"up":[{"embeddable":true,"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages\/1008"}],"wp:attachment":[{"href":"https:\/\/oopm.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}