New OO module idea - looking for suggestions
- From: bmillares <benny@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 01 Oct 2007 20:26:36 -0700
Hi,
I've been working on a module that provides encapsulation, inheritance
and strong typing. I know there are several OO frameworks already in
CPAN, but I have not seen any that implements the OO principles that
strictly. The module I'm proposing will provided private, protected
and public methods and properties. It will also implement the concept
of virtual methods, and only methods marked as such can be overridden
by the children.
Another key piece of functionality is that when a method is overridden
by a child, from the perspective of the parent the method behaves as
the original method did and the new method or property is only
available from the child down. Also private properties and method are
only visible in the class the implements them and the children are
free to use the same names without the problem of collisions or
overriding those entities.
Basically, it would be and OO implementation closer to how it's
currently implemented in Java or C#, my hope is that it would make
folks versed in those languages more comfortable with perl and allow
perl developer to explore and perhaps even enjoy some of the features
of those languages.
In order to make use of the functionality of the proposed module a
perl developer would simply have to inherit from the proposed module
and use function attributes to mark the functions as a properties or
methods and whether they are private, protected or public. Functions
marked as properties will be used for defining the property type and
how to handle gets and set within a tied hash which will be to object
core structure. Most of the overhead associated with enforcing the
encapsulation will take place during the CHECK phase and when classes
are instantiated, from there on they work off dispatch tables which
should be pretty fast. The biggest benefit would be for those folks
working under mod_perl as they will compile once and use many times.
Sorry for the rant, but I was wondering if there is any interest out
there for such a animal. If there is please let me know and I will
post the module for peer review.
Thanks,
bmillares
.
- Follow-Ups:
- Re: New OO module idea - looking for suggestions
- From: Mumia W.
- Re: New OO module idea - looking for suggestions
- Prev by Date: Using external REXX function libraries with PERL
- Next by Date: Re: New OO module idea - looking for suggestions
- Previous by thread: Using external REXX function libraries with PERL
- Next by thread: Re: New OO module idea - looking for suggestions
- Index(es):
Relevant Pages
|