How would a 'report' fit into MVC ? A design pattern question.

Discussion in 'Ruby' started by Nate Murray, Apr 29, 2006.

  1. Nate Murray

    Nate Murray Guest

    Greetings. I am writing a phone call tracking app, so I have a model
    'calls'. What I want to do is have some reporting about those calls,
    but I'm not sure what the best practice is for something like a report
    as it relates to the MVC pattern. It's not really an ActiveRecord
    because it doesn't have any persistent data. Should I implement a
    Report model object that is created for reporting? Or is this something
    that should be implemented between helpers and views? ( That is to ask,
    should I put the report logic in its own helper module? )

    If I choose to go the 'report model' route. Am I wrong in assuming that
    I probably shouldn't even start with rails' 'generate' scripts ( as the
    report wouldnt have tradition ties to a database ) ? I would think that
    something like this would best be built from the ground up.

    As you can tell, Im farely new to rails. Thanks for any help!

    -Nate
     
    Nate Murray, Apr 29, 2006
    #1
    1. Advertisements

  2. Someone will undoubtedly say I'm wrong, but this is my opinion:

    Your view would be the visualization of the report, e.g, tables, charts, etc.

    Your model would be the data generated from the processing the
    parameters (static and dynamic).

    Your controller, if any, would be the parameters that the report would
    be generated from.


    There is no requirement to use activerecord in any part of rails,
    although it will make testing tough.

    HTH,

    -Erik
     
    Erik Hollensbe, Apr 29, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.