Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

Class inheritance explained

Thursday, March 14th, 2013 by Servage

When your work with object oriented programming you will often get across inheritance, which is the concept of classes providing functionality to each other, by either passing it on to a child class, or inheriting it from a parent class. In modern days this has been extended with other concept like PHP does with “implements” and “traits“.

Understanding class inheritance is significant for your development workflows and opens up so many doors to more advanced and versatile coding, which is a great benefit for your project. Integrating similar code, inheriting same code, working object-oriented is the key to efficient work.

Types of inheritance

  • Single Inheritance
  • Multilevel Inheritance
  • Multiple Inheritance
  • Hierarchical Inheritance
  • Hybrid Inheritance

Each of these types of inheritance has unique characteristics which can beneficial to a scenario. Which type to use and how to implement it, depends on your specific needs. Please read more details about the inheritance types here, where it is conceptually well explained.

Class inheritance explained, 3.2 out of 5 based on 5 ratings
Categories: Guides & Tutorials, Tips & Tricks


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

No comments yet (leave a comment)

You are welcome to initiate a conversation about this blog entry.

Leave a comment

You must be logged in to post a comment.