New OO module idea - looking for suggestions



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

.



Relevant Pages

  • Re: CoBOL moved to OO
    ... just as civil or electrical engineering ... > the supplied functions to access data fail, it can be relatively easy to ... can not only obtain the functionality I require, I can get it "in spades"... ... > true for data encapsulation, logical abstraction, or anywhere else. ...
    (comp.lang.cobol)
  • Re: Code reuse
    ... You asked specifically about 2 things: Inheritance and Interfaces. ... functionality, rather than functions existing outside of any class. ... re-use the base class and its functionality in each derived class. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: multiple inheritance
    ... Top level specification of state space in multiple inheritance ... The PI design technique is a wrapper for functionality around ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: multiple inheritance
    ... Top level specification of state space in multiple inheritance ... The PI design technique is a wrapper for functionality around ... The re-write of your code shows the 'statically false' ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: CoBOL moved to OO
    ... >>an engineering discipline, just as civil or electrical engineering ... and have a complex structured system that uses common functionality. ... > true for data encapsulation, logical abstraction, or anywhere else. ... Are you saying CBSE isn't worth it? ...
    (comp.lang.cobol)