On Thursday 13 Jan 2011 14:55:10 Sunita Rani Pradhan wrote:
> Hi Shlomi
> 
>       Thanks for your help . I meant that , in what kind of scenario
> we should use OOP features(in perl) ?

Well, often you need to create more than one instance of something. In that 
case, consider creating a class and instantiating objects of it. OOP is also 
useful for standardising the interface of your project, and for shortening the 
amount of code needed to delegate records from one subroutine to another and 
to export and import functions.

Inheritance and role composition give you powerful tools to reuse code and 
over-ride parts of it. 

You may wish to read these parts of "The Art of Unix Programming" for some 
discussion of OOP:

* http://www.faqs.org/docs/artu/unix_and_oo.html

* http://www.faqs.org/docs/artu/ch14s04.html

However, I feel that OOP as it is implemented in C++ leaves a lot to be 
desired, and that "C++ supports Object Oriented Programming roughly as much as 
COBOL supports Functional Programming.", and that the way Perl implemented OOP 
is much better than C++'s.

Please read the rest of the resources I've linked to (and other resources 
online and offline). I'm not saying that you should always use OOP, but it's 
important to know, and I found it of great utility.

Regards,

        Shlomi Fish


-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Stop Using MSIE - http://www.shlomifish.org/no-ie/

Chuck Norris can make the statement "This statement is false" a true one.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to