Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Advice on OO Program structure & organization

by Anonymous Monk
on Dec 13, 2004 at 17:08 UTC ( [id://414463]=note: print w/replies, xml ) Need Help??


in reply to Re: Advice on OO Program structure & organization
in thread Advice on OO Program structure & organization

This is bad for many reasons, namely you have no way of instantiating a Foo without using a file, in this case. There is nothing wrong with adding functions for read/write, as this is common in serialization idioms (they'll even call other methods of child objects, etc).

As the more versed in softare design will know, using an existing module has nothing to do with OO, nor does OO have anything to do with reusability. It is commonly parroted that non-OO code is not reusable, and it may better be said that non-namespaced code is not reusable. It has nothing to do with object-orientation. Structure-oriented code can easily handle reuse, OO when yielded properly has greater advantages of course -- such as polymorphism.

  • Comment on Re^2: Advice on OO Program structure & organization

Replies are listed 'Best First'.
Re^3: Advice on OO Program structure & organization
by gmpassos (Priest) on Dec 14, 2004 at 23:11 UTC
    The code above is just an example! duh! About OO and reusability. Well, OO doesn't guarantee reusability, but I dare you to make good reusability without OO.

    Graciliano M. P.
    "Creativity is the expression of liberty".

      Oh, I don't know, let's say ... umh ... the Linux kernel?

      Most functional programming, such as Lisp/Scheme, also eclipses OO code reuse ... many times over.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://414463]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-24 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found