So, I was thinking about OOP and inheritance, and I got to thinking about a new construct in OOP where you specify dominant and recessive properties/methods like with real inheritance.
Consider two objects Mother, Father in a fictional language:
Then, you could create a new object that doesn't have a particular type itself, but is instead a juxtaposition of both provided types upon construction.
I think this could be interesting if developed further.
Consider two objects Mother, Father in a fictional language:
class Mother { dominant void doWork() { } void beMotherly() { } } class Father { void doWork() { } void beFatherly() { } }
Then, you could create a new object that doesn't have a particular type itself, but is instead a juxtaposition of both provided types upon construction.
Child child = new (Father, Mother); child.doWork(); // calls mother's doWork(); child.beMotherly(); child.beFatherly();
I think this could be interesting if developed further.
0 Comments On This Entry
Tags
My Blog Links
Recent Entries
-
-
-
Programming Construct Idea
on Dec 14 2018 05:57 PM
-
-
Recent Comments
Search My Blog
3 user(s) viewing
3 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)