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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

This is a credible effort and I enjoyed looking at it. I'd like to make a few comments about your design.

Objects aside, it is good to separate data from code. Here, the ability to read a list of team data from a file, and to use as default the MLB data from a __DATA__ section, would be one approach to generalizing the module. The separation would support introducing Team as an object and feeding the data to a constructor.

You have a well-defined level of abstraction for OO. All the information needed for identifying teams in a box score are here. All the teams that can conceivably play an official game with each other are listed. You omit complications like roster, management, ownership, and farm system.

OO design models some abstraction which is always informed by the size of the problem space. By definition, a module designer does not have the luxury of a well-defined problem space. With modules, the measure of success is the number of unanticipated ways the module can be used. Could a fantasy league use the module? Could a high school conference? Could ESPN's box score server? In that last case, you have the problem that the server may run for months or years. On the fly, can it handle league expansion and movement of teams?

There are many distinct Teams, but each is unique to itself. The constructor should produce a single instance, and all methods should deal in references to that instance. This is a restatement of merlyn's principal objection.

Thanks for posting this interesting module. I found it thought-provoking.

After Compline,
Zaxo


In reply to Re: Sports::Baseball::Teams by Zaxo
in thread Sports::Baseball::Teams by ChemBoy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-23 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found