[{"data":1,"prerenderedAt":145},["ShallowReactive",2],{"i-mdi:theme-light-dark":3,"i-mdi:menu":8,"i-mdi:linkedin":10,"i-mdi:github":12,"i-mdi:email-outline":14,"article-\u002Farticles\u002Finheritance-family-in-programming":16,"i-mdi:arrow-left":143},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cpath fill=\"currentColor\" d=\"M7.5 2c-1.79 1.15-3 3.18-3 5.5s1.21 4.35 3.03 5.5C4.46 13 2 10.54 2 7.5A5.5 5.5 0 0 1 7.5 2m11.57 1.5l1.43 1.43L4.93 20.5L3.5 19.07zm-6.18 2.43L11.41 5L9.97 6l.42-1.7L9 3.24l1.75-.12l.58-1.65L12 3.1l1.73.03l-1.35 1.13zm-3.3 3.61l-1.16-.73l-1.12.78l.34-1.32l-1.09-.83l1.36-.09l.45-1.29l.51 1.27l1.36.03l-1.05.87zM19 13.5a5.5 5.5 0 0 1-5.5 5.5c-1.22 0-2.35-.4-3.26-1.07l7.69-7.69c.67.91 1.07 2.04 1.07 3.26m-4.4 6.58l2.77-1.15l-.24 3.35zm4.33-2.7l1.15-2.77l2.2 2.54zm1.15-4.96l-1.14-2.78l3.34.24zM9.63 18.93l2.77 1.15l-2.53 2.19z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cpath fill=\"currentColor\" d=\"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":11},"\u003Cpath fill=\"currentColor\" d=\"M19 3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm-.5 15.5v-5.3a3.26 3.26 0 0 0-3.26-3.26c-.85 0-1.84.52-2.32 1.3v-1.11h-2.79v8.37h2.79v-4.93c0-.77.62-1.4 1.39-1.4a1.4 1.4 0 0 1 1.4 1.4v4.93zM6.88 8.56a1.68 1.68 0 0 0 1.68-1.68c0-.93-.75-1.69-1.68-1.69a1.69 1.69 0 0 0-1.69 1.69c0 .93.76 1.68 1.69 1.68m1.39 9.94v-8.37H5.5v8.37z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":13},"\u003Cpath fill=\"currentColor\" d=\"M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":15},"\u003Cpath fill=\"currentColor\" d=\"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2zm-2 0l-8 5l-8-5zm0 12H4V8l8 5l8-5z\"\u002F>",{"id":17,"title":18,"body":19,"category":128,"description":129,"extension":130,"meta":131,"navigation":132,"path":133,"published":134,"seo":135,"stem":136,"tags":137,"__hash__":142},"articles\u002Farticles\u002Finheritance-family-in-programming.md","Inheritance - Family in programming",{"type":20,"value":21,"toc":119},"minimark",[22,27,35,42,45,49,60,65,69,72,81,84,89,94,97,102],[23,24,26],"h2",{"id":25},"what-is-class-inheritance","What is Class Inheritance?",[28,29,30,31],"p",{},"Class Inheritance is based on connections between parent class (superclass) and child class (subclass). The child class is able to inherit and use parents’ class (public or protected) variables and methods as the same as its own. It has few advantages like among others repetition avoidance what gives the ability to create bigger systems without making mess or easy further system development without the need to alter variables and methods trough all classes because shared instances are defined only once. ",[32,33,34],"strong",{},"Inherited Class Example:",[28,36,37],{},[38,39],"img",{"alt":40,"src":41},"Image","\u002Fimages\u002F3\u002F1.jpg",[28,43,44],{},"InsuredPatient class is using Patients’ class public attributes instances (Name, Age, MoneyOwed and AmountOfTreatments) and also public operations (AddTreatment and PayTheBill). The InsuredPatient subclass is extending its functionality with two variables (companyName and percentageCover) and one method (ChargeInsurance) which are accessible only from objects with type InsuredPatient.",[23,46,48],{"id":47},"how-to-create-inherited-class-structure","How to create inherited class structure?",[28,50,51,54,55,59],{},[32,52,53],{},"Generalization"," is one the processes used to create inherited class structures of extracting shared characteristics from two or more classes, and combining them into a generalized superclass ",[56,57,58],"em",{},"(Sourcemaking.com, 2017)",".",[28,61,62],{},[38,63],{"alt":40,"src":64},"\u002Fimages\u002F3\u002F2.jpg",[28,66,67],{},[56,68,58],{},[28,70,71],{},"Firstly, we have to determine which attributes are repetitive. These attributes will go to the top of the tree and will be elements of the parent class. Not-repetitive attributes will be moved to children classes.",[28,73,74,75,78,79,59],{},"In the example above, two classes (Piece of luggage and Piece of cargo) got combined into 1 superclass (Freight) and 2 subclasses. In contrast to generalization, ",[32,76,77],{},"specialization"," leads to creating new subclasses from an existing class ",[56,80,58],{},[28,82,83],{},"If some of the class attributes apply only to a group of objects, we can divide class for superclass and two or more subclasses. Specialization is inverse of generalization.",[28,85,86],{},[38,87],{"alt":40,"src":88},"\u002Fimages\u002F3\u002F3.jpg",[28,90,91],{},[56,92,93],{},"(Schardt and Chonoles, 2013)",[28,95,96],{},"If you have any questions, don't hesitate to contact me.",[98,99,101],"h3",{"id":100},"references","References",[28,103,104,105,112,113,118],{},"dzone.com. (2012). Polymorphism and Inheritance are Independent of Each Other - DZone Java. [online] Available at: ![Image](",[106,107,111],"a",{"href":108,"rel":109},"https:\u002F\u002Fdzone.com\u002Farticles\u002Fpolymorphism-and-inheritance%22%3Ehttps:\u002F\u002Fdzone.com\u002Farticles\u002Fpolymorphism-and-inheritance",[110],"nofollow","https:\u002F\u002Fdzone.com\u002Farticles\u002Fpolymorphism-and-inheritance\">https:\u002F\u002Fdzone.com\u002Farticles\u002Fpolymorphism-and-inheritance"," [Accessed 30 Oct. 2017]. Sourcemaking.com. (2017). Design Patterns and Refactoring. [online] Available at: ![Image](",[106,114,117],{"href":115,"rel":116},"https:\u002F\u002Fsourcemaking.com\u002Fuml\u002Fmodeling-it-systems\u002Fstructural-view\u002Fgeneralization-specialization-and-inheritance%22%3Ehttps:\u002F\u002Fsourcemaking.com\u002Fuml\u002Fmodeling-it-systems\u002Fstructural-view\u002Fgeneralization-specialization-and-inheritance",[110],"https:\u002F\u002Fsourcemaking.com\u002Fuml\u002Fmodeling-it-systems\u002Fstructural-view\u002Fgeneralization-specialization-and-inheritance\">https:\u002F\u002Fsourcemaking.com\u002Fuml\u002Fmodeling-it-systems\u002Fstructural-view\u002Fgeneralization-specialization-and-inheritance"," [Accessed 30 Oct. 2017].",{"title":120,"searchDepth":121,"depth":121,"links":122},"",2,[123,124],{"id":25,"depth":121,"text":26},{"id":47,"depth":121,"text":48,"children":125},[126],{"id":100,"depth":127,"text":101},3,"C#","Class Inheritance is based on connections between parent class (superclass) and child class (subclass). Child class is able to inherit and use parents’ class (public or protected) variables and methods as same as its own. It has few advantages like among others repetition avoidance what gives ability to create bigger systems without making mess or easy further system development without need to alter variables and methods trough all classes because shared instances are defined only once.","md",{},true,"\u002Farticles\u002Finheritance-family-in-programming",null,{"title":18,"description":129},"articles\u002Finheritance-family-in-programming",[128,138,139,140,141],"CSharp","Inheritance","Good Habits","Class Inheritance","WBEjSKXVY0y2vQQ8BYRBC9gRQv5ZqVbNXbvU1qBfpfs",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":144},"\u003Cpath fill=\"currentColor\" d=\"M20 11v2H8l5.5 5.5l-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5L8 11z\"\u002F>",1783161036186]