{"id":21,"date":"2023-05-03T20:37:57","date_gmt":"2023-05-03T18:37:57","guid":{"rendered":"https:\/\/oopm.org\/?page_id=21"},"modified":"2025-01-20T10:47:31","modified_gmt":"2025-01-20T09:47:31","slug":"an-introduction-to","status":"publish","type":"page","link":"https:\/\/oopm.org\/?page_id=21","title":{"rendered":"An introduction to Object-Oriented Programming as Modeling"},"content":{"rendered":"<div class=\"pdfprnt-buttons pdfprnt-buttons-page pdfprnt-top-right\"><a href=\"https:\/\/oopm.org\/index.php?rest_route=wpv2pages21&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=wpv2pages21&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<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\">\n<p class=\"wp-block-paragraph\" style=\"margin-top:var(--wp--preset--spacing--20);margin-right:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--20);margin-left:var(--wp--preset--spacing--80)\"><em>Ole Lehrmann Madsen<\/em><br>Aarhus University<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p class=\"wp-block-paragraph\" style=\"margin-right:var(--wp--preset--spacing--50);margin-left:var(--wp--preset--spacing--50)\"><em>Birger M\u00f8ller-Pedersen<\/em><br>University of Oslo<\/p>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">This book is a general introduction to object-oriented programming with emphasis on modeling. <\/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:45%\">\n<p class=\"wp-block-paragraph\">When creating a program to support a task or solve a problem, you need to construct within the computer a model of that aspect of the problem domain to which the program will be applied. In such a model, relevant phenomena and concepts from the application domain must be represented by some entities within the computer.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:55%\">\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#e3e9ee\">The intended readers of this book are students and others that want to learn programming and more specifically object-oriented programming. No previous knowledge of programming is required. We expect the readers to be at the age of 17-19 or older.<\/p>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The phenomena to be considered may be physical entities like bank accounts, patient record, vehicles, robots, etc. Physical entities are characterized by properties like weight and color of a vehicle. Physical entities may also carry out activities that may change the physical entities or observe properties of the physical entities. A&nbsp;concept&nbsp;is a generalized idea of a collection of phenomena, based on knowledge of common properties of elements in the collection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Phenomena are represented by objects, which are the computer entities considered in this book. Objects may hold data and carry out computations. Concepts are represented by classes, which technically are templates for generating objects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A program is described in a programming language and may be executed on a computer which then generates a so-called <em>program execution<\/em>, which is considered a model of the aspect of the application domain being considered.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Programming languages are complex entities and learning the details of such a language may be difficult and take time. There is great variation in the complexity of different languages. In this book we use a language with a relatively low complexity, but still the technicalities of this language may be a hindrance for some readers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We introduce a conceptual framework for organizing and understanding knowledge about application domains. This includes understanding phenomena and concepts and conceptual means such as classification, composition and contextualization. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are many books on object-oriented programming, just as there are many books on object-oriented modeling. Most textbooks on object-oriented programming do not consider modeling, but focus on the technical aspects of a programming language.&nbsp;The books on object-oriented modelling include weak links to programming and often lacks a proper conceptual framework.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this book, we provide an introduction to object-oriented programming as&nbsp;modeling. We thus emphasize modeling, and we demonstrate that modeling can be done as part of programming.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A a description in a programming language is almost always made in the form of a text whereas a description in a modeling language is mainly made as a graphical diagram &#8211; the <a href=\"https:\/\/www.uml.org\">Unified Modeling Language (UML)<\/a> is an example of this. For this reason, many people often take for granted that you have to use a graphical language to do object-oriented modeling.<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-custom-color-3-color\"> <\/mark><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this book, we claim that you can use your programming language for modelling. You may use UML as well, but there is no need to. We do use graphical diagrams to illustrate our programs elements, whenever useful, but only as illustrations. If you prefer to use UML or any other graphical notation, this is of course possible.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first object-oriented language, SIMULA, was intended for programming as well as modeling, but unfortunately this is not central in mainstream object-oriented programming.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We believe that the SIMULA approach is the right way to do it. The example programs in this book are therefore made in a simple modern language that is intended for programming as well as modeling, that is we go back to the future as pioneered by SIMULA.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The language being used is called qBeta and is derived from the Beta language. A preliminary description of qBeta may be found <a href=\"http:\/\/qbeta.dev\" data-type=\"link\" data-id=\"http:\/\/qbeta.dev\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The plan is to supply descriptions of how to make such programs in mainstream languages like, C++, Java, C#, and Python. We do, however, think that the current version may be a useful supplement to most courses on object-oriented programming and we think most instructors should be able to build the bridge between this book and textbooks about a given programming language.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some people may find it confusing that students may have to deal with syntax of the language in this book and then in addition the syntax of a language like C++, Java, C#, or Python. We do, however, think that it is essential that students are trained in understanding language mechanisms independent of syntax of mainstream languages.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Students should start reading the introduction and subsequent chapters on objects and classes. They may then alternate between reading about similar mechanism of a mainstream language and further chapters in this book. It is essential that they try out the examples provided in this book.<\/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\">\n<p class=\"wp-block-paragraph\">We recommend starting with <a href=\"https:\/\/oopm.org\/?page_id=52\" data-type=\"page\" data-id=\"52\">1. Introduction<\/a>.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p class=\"has-small-font-size wp-block-paragraph\">The preface is only relevant if you want to know the background\/motivation for writing this book.<\/p>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The field below is a simple preliminary search field that search the pages in this book.<\/p>\n\n\n<form role=\"search\" method=\"get\" action=\"https:\/\/oopm.org\/\" class=\"wp-block-search__button-outside wp-block-search__text-button wp-block-search\" ><label class=\"wp-block-search__label screen-reader-text\" for=\"wp-block-search__input-1\" >Search<\/label><div class=\"wp-block-search__inside-wrapper\"  style=\"width: 100%\"><input class=\"wp-block-search__input\" id=\"wp-block-search__input-1\" placeholder=\"\" value=\"\" type=\"search\" name=\"s\" required \/><button aria-label=\"Search\" class=\"wp-block-search__button wp-element-button\" type=\"submit\" >Search<\/button><\/div><\/form>\n\n\n<p class=\"has-background has-tiny-font-size wp-block-paragraph\" style=\"background-color:#e3e9ee\">This is the first version of this book.&nbsp; Most parts are complete with a few exceptions mainly regarding formatting of the pages, resolution and size of illustrations,&nbsp;and lack of streamlining of diagrams.<br>For the next versions of the book, some new parts are planned \u2013 see chapter <a href=\"https:\/\/oopm.org\/?page_id=2895\" data-type=\"page\" data-id=\"2895\">23. Planned parts of the book<\/a>.<br>Since this is the first version, we have not received feedback from any users.&nbsp;This means that the text including example&nbsp;code may contain errors or be hard to understand.<br>There may language elements we have forgotten to explain just as we may use terms that are not defined or need a better definition.<br>At the end of chapter <a href=\"https:\/\/oopm.org\/?page_id=52\" data-type=\"page\" data-id=\"52\">1. Introduction<\/a>, we have listed a number of inconveniences that we hope to get rid of.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/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=21\" 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>Ole Lehrmann MadsenAarhus University Birger M\u00f8ller-PedersenUniversity of Oslo This book is a general introduction to object-oriented programming with emphasis on modeling. When creating a program to support a task or solve a problem, you need to construct within the computer a model of that aspect of the problem domain to which the program will be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-21","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\/21","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=21"}],"version-history":[{"count":86,"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages\/21\/revisions"}],"predecessor-version":[{"id":11298,"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages\/21\/revisions\/11298"}],"wp:attachment":[{"href":"https:\/\/oopm.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}