C# - Naming a value combined "getter/setter" method (WebForms & Binding)

Posted by tyndall on Stack Overflow See other posts from Stack Overflow or by tyndall
Published on 2010-04-29T16:27:45Z Indexed on 2010/04/29 18:27 UTC
Read the original article Hit count: 289

Filed under:
|
|
|
|

Looking for some help on some names for a project I'm currently working on. I don't have a compsci degree so I don't know what to call this.

I have a method called TryToGetSetValue(Direction direction, object value, object valueOnFail)

Then there would be a Direction enum

public enum Direction
{
    ModelToForm,
    FormToModel
}

Background This is a legacy ASP.NET application. The models, database, and mainframe are designed poorly. I can't put in MVP or MVC patterns yet (too much work). ASP.NET code is a ridiculous mess (partial pages, single-page design, 5x the normal amount of jQuery, everything is a jQuery UI dialog). I'm just trying to put in a bridge so then I can do more refactoring over the next year.

I have ~200 fields that need to be set on a GET and written back on a POST. I trying not to x2 these 200 fields and have 400 lines of code to support.

What would you call my method? enum? Is there so other form of binding that would be easy to use instead? I'm not a fan of the DetailsView or FormView built-ins of ASP.NET WebForms.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about binding