[BNE-PM] OO perl
Don.Simonetta at mincom.com
Don.Simonetta at mincom.com
Tue Aug 20 02:30:12 CDT 2002
Well I've learned something new today - I'd never heard of Class::Contract
until now. I've managed to track it down on cpan
(http://www.cpan.org/authors/id/D/DC/DCONWAY/Class-Contract-1.00.readme).
This sounds like it plugs a few of the deficiencies in perl's OO. Having
only read a book on java and never coded in it, I would have said that
java is nicer for OO. Especially in terms of syntax.
Tony, can you give a breif summary of object composition and aspect
oriented programming? Is this a move away from one of the fundamentals of
OO -namely inheritance?
>>They are both quite similar to use. I haven't looked at how to do
>>database connection pooling in dbi but it is quite easy now in java with
>>jdbc2. It can take more code in java to get some things done in perl
but
>>the object orientation in java is better than it was in perl.
>
>No, I'd say the object orientation in Java is not better in Perl. Try the
>Class::Contract module, which gives you class invariants, abd true pre
and
>post conditions (and the pre conditions can refer to the previous state
of
>the object!). You can't do that in Java!
I'm hoping that pre and post conditions will come in to java in the
future,
some interesting work is being done in this regard under the title of
Aspect Oriented Programming and a java implementation (AspectJ -
www.aspectj.org) is available.
>(Java still doesn't have multiple inheritence - and don't tell me I don't
>need it!)
I wouldn't presume to tell you that, I will tell you, however, that I
don't
need it... :-). An interesting perspective on inheritance that is being
stated by a number of the OO gurus is that when designing we should favour
Object Composition over Inheritance which in my view diminishes the
arguments for multiple inheritance. Aspect Oriented Programming gets
around some of the issues one would solve with multiple inheritance by
providing "aspects" that stripe different functional areas of an
application.
--
This transmission is for the intended addressee only and is confidential information. If you have received this transmission in error, please delete it and notify the sender. The contents of this e-mail are the opinion of the writer only and are not endorsed by the Mincom Group of companies unless expressly stated otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/archives/brisbane-pm/attachments/20020820/858a7536/attachment.htm
More information about the Brisbane-pm
mailing list