Tuesday, 29 January 2019

What is inheritance of the coldfusion framework ?

Inheritance is one of the ancient concept of object oriented programming concept which was generally popularised in the C++ and Java. In it, an object gets the access to the properties of the another class object. The object getting access to the property is called as child and the access giving class is also known as parent class.

Inheritance is generally used to stop the code duplication. In a general coldfusion environment, a super base class is generally generated and many properties, functions and methods are declared in it. The access of that class is provided by the child class. It is also known as the sub class.
For example - a book is an entity, then in coldfusion, there will be three properties -

title
price
description
These properties will be similar for other classes pertaining different entities like - CD, DVD, gadget etc. So here in this example, book is a

super/parent class but the CD, DVDs are the main child class. By the different objects, we can access the different properties of the “book” parent class.  
Sometimes a function is used within the child class which is also similar to a function defined in the base class, and the method is used in that child class, the method is called the overridden function and the process is called function overriding.

reference link - 

No comments:

Post a Comment