Provide simple objects for UI

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cleanwire@yahoo.com

    #1

    Provide simple objects for UI

    I have a given page which displays data that while related, is spread
    across different tables. I don't want the UI to call ThisBC.Select() ,
    ThatBC.Select() , OtherBC.Select( ), etc and then "know" how to map data
    from these result sets to its fields. I think that is too much
    responsibility for the UI to handle.
    Instead, I'd like the UI to use a "helper" class which will do
    ThisBC.Select() , ThatBC.Select() , OtherBC.Select( ), then map the
    result set into an easy to use object which mimics what should be on
    the screen. The helper class would return this object to the UI,
    which would then easily map the object's properties to its form
    fields. Saving data would be similar, the UI would populate the
    object, then give it to the helper, which would know to start a
    transaction, persist the data across the three tables, etc.
    Would the "helper" class in this case qualify as a controller? Would
    MVC or MVP be overkill? Thanks for any thoughts/advice. Adam
  • Jonathan Wood

    #2
    Re: Provide simple objects for UI

    It sounds to me that you just need to create a class, which Visual Studio
    will off to place in the App_Code folder. Put a reference to the class's
    namespace and call the helper methods in one of your page's handlers.

    --
    Jonathan Wood
    SoftCircuits Programming


    <cleanwire@yaho o.comwrote in message
    news:2e82236f-835e-4ea8-916b-90e7e2eeca12@i3 6g2000prf.googl egroups.com...
    >I have a given page which displays data that while related, is spread
    across different tables. I don't want the UI to call ThisBC.Select() ,
    ThatBC.Select() , OtherBC.Select( ), etc and then "know" how to map data
    from these result sets to its fields. I think that is too much
    responsibility for the UI to handle.
    Instead, I'd like the UI to use a "helper" class which will do
    ThisBC.Select() , ThatBC.Select() , OtherBC.Select( ), then map the
    result set into an easy to use object which mimics what should be on
    the screen. The helper class would return this object to the UI,
    which would then easily map the object's properties to its form
    fields. Saving data would be similar, the UI would populate the
    object, then give it to the helper, which would know to start a
    transaction, persist the data across the three tables, etc.
    Would the "helper" class in this case qualify as a controller? Would
    MVC or MVP be overkill? Thanks for any thoughts/advice. Adam

    Comment

    • cleanwire@yahoo.com

      #3
      Re: Provide simple objects for UI

      I think the pattern for this is View Helper....
      http://java.sun.com/blueprints/corej...ViewHelper.htm.
      Thanks for the suggestion!

      Comment

      Working...