Provide simple objects for UI

C

cleanwire

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
 
J

Jonathan Wood

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top