Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: When is a module too minimal?

by Ovid (Cardinal)
on Jul 19, 2006 at 13:56 UTC ( #562287=note: print w/replies, xml ) Need Help??


in reply to When is a module too minimal?

As noted, there's nothing wrong with what you've done. Here's a bit more for you to think about.

You've written a class with one constructor and one method. A class has a dual role. First, it must provide everything it needs to provide. That is to say, it must be "complete" and that tends to increase its size. However, a class is also frequently an element of code reuse and then it should be as small as possible. Thus, you have competing pressures on the classes and this can cause difficulties with design.

If you have a small class which does everything you need to do, you really don't have as much worry about that competing pressure and this is a good thing. And if you're really, really crazy, you can read a bit more about the problem and strengths and weaknesses of various solutions to it.

Cheers,
Ovid

New address of my CGI Course.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2021-06-22 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (102 votes). Check out past polls.

    Notices?