{"id":1500,"date":"2020-05-25T11:08:59","date_gmt":"2020-05-25T05:38:59","guid":{"rendered":"https:\/\/binaryterms.com\/?p=1500"},"modified":"2021-01-18T11:22:59","modified_gmt":"2021-01-18T05:52:59","slug":"object-orientation","status":"publish","type":"post","link":"https:\/\/binaryterms.com\/object-orientation.html","title":{"rendered":"Object Orientation"},"content":{"rendered":"<p><strong>Object Orientation<\/strong> is the software engineering concept which represents the software as a cluster of distinct <strong>objects<\/strong>. Each object comprises both <strong>data structure<\/strong> i.e. it\u2019s storage structure\u00a0and <strong>functioning<\/strong> i.e. its behaviour.<\/p>\n<p>In object orientation concept data structure and behaviour of each object is tightly coupled. The object orientation concept is broadly classified into four aspects as discussed below.<\/p>\n<h2>Four Concepts of Object Orientation<\/h2>\n<ol>\n<li><a href=\"#Identity\">Identity<\/a><\/li>\n<li><a href=\"#Classification\">Classification<\/a><\/li>\n<li><a href=\"#Inheritance\">Inheritance<\/a><\/li>\n<li><a style=\"background-color: #ffffff\" href=\"#Polymorphism\">Polymorphism<\/a><\/li>\n<\/ol>\n<p><a name=\"Identity\"><\/a><\/p>\n<h3>1. Identity<\/h3>\n<p><strong>Identity<\/strong> the term itself means identification or specification of the entities present in the data. The discrete or distinguishable entities present in the data are termed as an <strong>object<\/strong>. The object can be basically identified into two categories concrete objects and conceptual objects.<\/p>\n<p><strong>Concrete objects<\/strong> are those which can be sensed like an account in a bank, file in a file system. We access or sense these object. <strong>Conceptual objects<\/strong> are those which are based on the concept like a policy of a bank which cant be sensed but it is there in the data.<\/p>\n<p>So, every object has a distinct identity. Even if two objects have all the attribute values same then also, they are discrete and can be identified uniquely. Like, for example, consider two cars of a same company, of the same model, same colour but still, we will consider the two cars as different entity.<\/p>\n<p>In a programming language, these objects can be accessed using a <strong>unique handle<\/strong>. Different languages implement this unique handle using the address, array index, pointers etc. The content of an object i.e. attributes of an object can\u2019t be changed by the user directly, it can only be changed by the <strong>method<\/strong> of the object. This prevents the inconsistency of the object.<br \/>\n<a name=\"Classification\"><\/a><\/p>\n<h3>2. Classification<\/h3>\n<p>In object orientation the <strong>classification<\/strong> is based on the object\u2019s <strong>structure<\/strong> and <strong>behaviour<\/strong>. The objects that possess the same data structure and function are classified to a group termed as a <strong>class<\/strong> in object orientation. For example, we consider a class <strong>Shapes<\/strong> then instances of these class such as triangle, square, hexagon etc. will be termed as <strong>objects<\/strong>.<\/p>\n<p>Now, we can group all instances or objects i.e. square, triangle, hexagon etc. to a class <strong>Shape<\/strong> as they all will have same data structure i.e. side, colour, vertices etc. and they will have same functions like, draw, erase, move etc.<\/p>\n<p>If we talk of class, then a class is an <strong>abstraction<\/strong> that means a class incorporate only those data structure and behaviour of the object that is important from the application point of view and it ignores the rest.<\/p>\n<p>The objects belonging to the same class have the same attributes (data structure) and operations or function (behaviour). But each instance or object possesses its own value for attributes which makes it different from other objects belonging to the same class. These objects are directly referenced through their class.<br \/>\n<a name=\"Inheritance\"><\/a><\/p>\n<h3>3. Inheritance<\/h3>\n<p><strong>Inheritance<\/strong> is the most important concept in object orientation. Inheritance refers to the <strong>sharing<\/strong> of <strong>attributes<\/strong> and <strong>functions<\/strong> between the two classes. This sharing is based on the <strong>hierarchical relationship<\/strong>. Among the two classes that share attributes and functions, one is the <strong>super class<\/strong> and the other is <strong>sub class<\/strong>.<\/p>\n<p>The <strong>super class<\/strong> always has the general attributes and functions that are common in both super class and sub class whereas the <strong>sub class<\/strong> inherit all the attributes and functions of its super class and also add its own attributes and functions.<\/p>\n<p>When a sub class is declared using object orientation it does not have to redeclare the attributes and functions of its super class. Sub class simply inherit all the features of its super class. For example, we have a super class <strong>Vehicle<\/strong> and two sub classes <strong>Bicycle<\/strong> and <strong>Car<\/strong>.<\/p>\n<p>Now, the general attribute of Vehicle like name, wheels, seats, etc.\u00a0 will be shared by both the sub classes. But the sub class Bicycle would add its unique feature paddles and sub class Car would add feature fuel-type.<\/p>\n<p>In object orientation, the concept of inheritance where the sub class reuses the features of super class reduces the repetition of code which in turn reduces the size of source code. This was one of the main advantages of object orientation.<br \/>\n<a name=\"Polymorphism\"><\/a><\/p>\n<h3>4. Polymorphism<\/h3>\n<p><strong>Polymorphism<\/strong> in object orientation means &#8216;of many forms&#8217;. In object orientation, a function or an operation is considered as polymorphic according to which a single function acts in a different way for different classes. Whenever a particular class implements a particular function it is termed as a method.<\/p>\n<p>Now let us take an example of a class person. A person behaves or functions differently in a different situation. On the basis of the situation provided, he may behave like an employee, a father, a brother, a son etc.<\/p>\n<p>In a similar way, the programming language based on object orientation allows the <strong>selection of the correct method<\/strong> provided the operation name and the object name that is being operated. It is not essential for the user of the application to have knowledge about the methods that are there in the application to execute a polymorphic function.<\/p>\n<p>So, this is all about the object orientation. We have discussed all the important features of object oreintation such as identity, classification, inheritance and polymorphism.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Object Orientation is the software engineering concept which represents the software as a cluster of distinct objects. Each object comprises both data structure i.e. it\u2019s storage structure\u00a0and functioning i.e. its behaviour. In object orientation concept data structure and behaviour of each object is tightly coupled. The object orientation concept is broadly classified into four aspects [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[10],"tags":[],"class_list":{"0":"post-1500","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-oot","7":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is Object Orientation? Inheritance &amp; Polymorphism - Binary Terms<\/title>\n<meta name=\"description\" content=\"Object Orientation is a concept where the software is considered as a cluster of distinct objects. Each object is comprised of data structure and function.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/binaryterms.com\/object-orientation.html\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Object Orientation? Inheritance &amp; Polymorphism - Binary Terms\" \/>\n<meta property=\"og:description\" content=\"Object Orientation is a concept where the software is considered as a cluster of distinct objects. Each object is comprised of data structure and function.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/binaryterms.com\/object-orientation.html\" \/>\n<meta property=\"og:site_name\" content=\"Binary Terms\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-25T05:38:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-18T05:52:59+00:00\" \/>\n<meta name=\"author\" content=\"Neha T\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Neha T\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/binaryterms.com\/object-orientation.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/binaryterms.com\/object-orientation.html\"},\"author\":{\"name\":\"Neha T\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe\"},\"headline\":\"Object Orientation\",\"datePublished\":\"2020-05-25T05:38:59+00:00\",\"dateModified\":\"2021-01-18T05:52:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/binaryterms.com\/object-orientation.html\"},\"wordCount\":869,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/binaryterms.com\/#organization\"},\"articleSection\":[\"Object Oriented Technology\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/binaryterms.com\/object-orientation.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/binaryterms.com\/object-orientation.html\",\"url\":\"https:\/\/binaryterms.com\/object-orientation.html\",\"name\":\"What is Object Orientation? Inheritance & Polymorphism - Binary Terms\",\"isPartOf\":{\"@id\":\"https:\/\/binaryterms.com\/#website\"},\"datePublished\":\"2020-05-25T05:38:59+00:00\",\"dateModified\":\"2021-01-18T05:52:59+00:00\",\"description\":\"Object Orientation is a concept where the software is considered as a cluster of distinct objects. Each object is comprised of data structure and function.\",\"breadcrumb\":{\"@id\":\"https:\/\/binaryterms.com\/object-orientation.html#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/binaryterms.com\/object-orientation.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/binaryterms.com\/object-orientation.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/binaryterms.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Object Orientation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/binaryterms.com\/#website\",\"url\":\"https:\/\/binaryterms.com\/\",\"name\":\"Binary Terms\",\"description\":\"The Computer Science &amp; IT Guide\",\"publisher\":{\"@id\":\"https:\/\/binaryterms.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/binaryterms.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/binaryterms.com\/#organization\",\"name\":\"Binary Terms\",\"url\":\"https:\/\/binaryterms.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png\",\"contentUrl\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png\",\"width\":400,\"height\":63,\"caption\":\"Binary Terms\"},\"image\":{\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe\",\"name\":\"Neha T\",\"url\":\"https:\/\/binaryterms.com\/author\/author\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Object Orientation? Inheritance & Polymorphism - Binary Terms","description":"Object Orientation is a concept where the software is considered as a cluster of distinct objects. Each object is comprised of data structure and function.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/binaryterms.com\/object-orientation.html","og_locale":"en_GB","og_type":"article","og_title":"What is Object Orientation? Inheritance & Polymorphism - Binary Terms","og_description":"Object Orientation is a concept where the software is considered as a cluster of distinct objects. Each object is comprised of data structure and function.","og_url":"https:\/\/binaryterms.com\/object-orientation.html","og_site_name":"Binary Terms","article_published_time":"2020-05-25T05:38:59+00:00","article_modified_time":"2021-01-18T05:52:59+00:00","author":"Neha T","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Neha T","Estimated reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/binaryterms.com\/object-orientation.html#article","isPartOf":{"@id":"https:\/\/binaryterms.com\/object-orientation.html"},"author":{"name":"Neha T","@id":"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe"},"headline":"Object Orientation","datePublished":"2020-05-25T05:38:59+00:00","dateModified":"2021-01-18T05:52:59+00:00","mainEntityOfPage":{"@id":"https:\/\/binaryterms.com\/object-orientation.html"},"wordCount":869,"commentCount":0,"publisher":{"@id":"https:\/\/binaryterms.com\/#organization"},"articleSection":["Object Oriented Technology"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/binaryterms.com\/object-orientation.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/binaryterms.com\/object-orientation.html","url":"https:\/\/binaryterms.com\/object-orientation.html","name":"What is Object Orientation? Inheritance & Polymorphism - Binary Terms","isPartOf":{"@id":"https:\/\/binaryterms.com\/#website"},"datePublished":"2020-05-25T05:38:59+00:00","dateModified":"2021-01-18T05:52:59+00:00","description":"Object Orientation is a concept where the software is considered as a cluster of distinct objects. Each object is comprised of data structure and function.","breadcrumb":{"@id":"https:\/\/binaryterms.com\/object-orientation.html#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/binaryterms.com\/object-orientation.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/binaryterms.com\/object-orientation.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/binaryterms.com\/"},{"@type":"ListItem","position":2,"name":"Object Orientation"}]},{"@type":"WebSite","@id":"https:\/\/binaryterms.com\/#website","url":"https:\/\/binaryterms.com\/","name":"Binary Terms","description":"The Computer Science &amp; IT Guide","publisher":{"@id":"https:\/\/binaryterms.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/binaryterms.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/binaryterms.com\/#organization","name":"Binary Terms","url":"https:\/\/binaryterms.com\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/","url":"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png","contentUrl":"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png","width":400,"height":63,"caption":"Binary Terms"},"image":{"@id":"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe","name":"Neha T","url":"https:\/\/binaryterms.com\/author\/author"}]}},"_links":{"self":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/1500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/comments?post=1500"}],"version-history":[{"count":2,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/1500\/revisions"}],"predecessor-version":[{"id":2195,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/1500\/revisions\/2195"}],"wp:attachment":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/media?parent=1500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/categories?post=1500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/tags?post=1500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}