Inheritance, an object oriented concept is to encourage reuseability in the design.
In PRPC two types of Class Inheritance is defined, one is Pattern Inheritance and another one is Direct Inheritance.
Pattern Inheritance
As per the name, pattern inheritance is about creating a child class by using the same name pattern of the parent class.
example-
Parent Class - Ilend-Home
Child Class - Ilend-Home-Mortgage
Direct Inheritance
Directed inheritance allows to specify or direct from what classes the current class may inherit.
example-
Ilend-Home-Mortgage could have directed inheritance to Work-Object-
Usage-
Lets consider class x needs to inherit from two different class hierarchy, we will be using Pattern inheritance to inherit from the same class hierarchy and direct to inherit from different class hierarchy.
For Ex. We have Framework and Implementation Layer.
Where my worktypes belongs to Implementation layer, by using Pattern i can inherit from Implementation layer class structure and using direct i can inherit from framework layer.
Rule Resolution and Class Inheritance
While Rule Resolution classes are always checked through pattern inheritance first all the way through the class pattern hierarchy, coming back to starting point and check through direct inheritance.
I tried to make it simple to understand, though any comments are most welcome.
In PRPC two types of Class Inheritance is defined, one is Pattern Inheritance and another one is Direct Inheritance.
Pattern Inheritance
As per the name, pattern inheritance is about creating a child class by using the same name pattern of the parent class.
example-
Parent Class - Ilend-Home
Child Class - Ilend-Home-Mortgage
Direct Inheritance
Directed inheritance allows to specify or direct from what classes the current class may inherit.
example-
Ilend-Home-Mortgage could have directed inheritance to Work-Object-
Usage-
Lets consider class x needs to inherit from two different class hierarchy, we will be using Pattern inheritance to inherit from the same class hierarchy and direct to inherit from different class hierarchy.
For Ex. We have Framework and Implementation Layer.
Where my worktypes belongs to Implementation layer, by using Pattern i can inherit from Implementation layer class structure and using direct i can inherit from framework layer.
Rule Resolution and Class Inheritance
While Rule Resolution classes are always checked through pattern inheritance first all the way through the class pattern hierarchy, coming back to starting point and check through direct inheritance.
I tried to make it simple to understand, though any comments are most welcome.
No comments:
Post a Comment