-
Notifications
You must be signed in to change notification settings - Fork 14
Object System
Stevan Little edited this page Sep 11, 2016
·
5 revisions
I suggest reading the Object Orientation in Perl is just a Design Pattern page first, it will help, this page is more about the specifics of the implementation.
My proposal is to add to the list of magic variables with;
-
%HAS
– this contains a key for every slot expected in the instance, the value associated with that key is a CODE reference which can be called to provide a default value for the slot. -
@DOES
– much like@ISA
this would contain strings (package names) to be composed in as a role
Then to establish some conventions such as;
- predeclared subroutines are treated as abstract methods
- standard instance creation protocol
- most easily done with a common base class (
mop::object
)
- most easily done with a common base class (