Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • In SQL, the minimum likely use case is:

    SELECT id, name, alignment FROM characters;
    With a class, the minimum likely use case is:

    object = Class.new;
    I don't think anyone who uses other than the pluralization that I use deserves a painful death, but I also don't see that the number of tables and classes needs to be tied.
    --
    rjbs
    • In SQL, the minimum likely use case is:

      SELECT id, name, alignment FROM characters;

      And each row you get back is made up of those attributes of a 'character'. Sure you get multiple rows, but I don't get how that's different from defining a class in order to instantiate multiple objects.

      With a class, the minimum likely use case is:

      object = Class.new;

      A common case in Rails is:

      @character_list = Character.find(:all)

      Which ultimately generates SQL along the lines of:

      SELECT * FROM CHARACTERS

      And the application will then instantiate one Character object for each row retrieved from the table. In this case there is a clear and deliberate one-to-