4

you guys ever seen a webservice returning view elements for the front end to interpret and generate views using a switch

switch(data.type)
{
case password:
// generate password field with returned value
...
}

is this really some new practice in back end / front end design ? it just frustrates me so much. web service should be returning data only. i can't maintain this code it's too much crap.

Comments
  • 2
    Well, you could return some metadata to base the render on, but frankly i have trouble imagining truly legit usecase for that.
  • 0
    i can't think of any reason to do that. the views are very clear and fixed they will always be the same.

    why do i have to return a json with username, fieldtype, labelfor, title, id, class.

    when i can return username. and have all the view details in the FE. i wish i can show you the code i have to fix a module written by another guy. i just can't get around it too much unnecessary shit.
Add Comment