Discussion
2
Replies
39375
Views
hcl technologies
Posted: July 27, 2015
Last activity: July 8, 2016
Closed
difference between pattern inheritance and direct inheritance
Hello,
can anybody explain difference between pattern inheritance and direct inheritance? and when to use pattern inheritance and when to use direct inheritance?
Kinds,
Dhanunjaya.
Pattern inheritance basically means inheritance of rules based on the name of the class. For example, if your class name is SAE-HRServices-Work-Candidate, then your parent class will be SAE-HRServices-Work. Any rules created in the parent class will be inherited by the Candidate class. And you continue to work your way up. Each "-" delineante a "parent".
Each class you create will also need to inherit from a specific class, i.e. parent. As opposed to pattern inherited parent (which you cannot chose, as the parent is already decided depending on the name of the class), you can choose the parent of your directly inherited class.
So, if you need to reuse rules from a certain class that is not found in the pattern inherited path, you can configure the class to directly inherit from the class that contain the reusable rules.