Can a Response have a Method?

16 views
Skip to first unread message

shapper

unread,
Mar 17, 2012, 1:07:49 PM3/17/12
to agath...@googlegroups.com
Hello,

I have a response which returns data to use, not always, in a chart.

Do you think it is a good approach to have a method inside the response that returns, when called, a Chart built from the response data?

  public class CountNotesByHourResponse : Response {

    public List<Tuple<DateTime, Int32>> Data { get; set; }

    public Chart GetChart(Int32 height, Int32 width, ChartType type) {
       // Build chart with Data
    }

  } // CountNotesByHourResponse

I see a few situations where a response method might be useful ...

Basically, I am looking at a response as more then a simple DTO ...

What do you think?

Thank You,
Miguel
Reply all
Reply to author
Forward
0 new messages