Tuesday, 6 August 2013

Rampant abstraction is driving me to distraction and I feel like putting Little Lord Fauntleroy in traction

Rampant abstraction is driving me to distraction and I feel like putting
Little Lord Fauntleroy in traction

Here's an example of why I'm dubious about all this "elegant"
(fancy-pants) abstraction (my first rant diesbzg is here:
http://codereview.stackexchange.com/questions/28990/fancy-pants-vs-cowboy-coding).
I'm working on an asp.net app that uses the MVC pattern. One of the model
members is/was a generic List of String, but I'm thinking about changing
the model member to a string (it would contain a csv value, such as
"2,7,11,42,77,86").
But binding it to my html is a nightmare, because the element that
represents these values is a dynamically-generated array of checkboxes
(via a custom plugin). So I can't just use the html element's name
attribute to bind to the model member. How to do it? is quite a conundrum
(http://forums.asp.net/p/1927698/5475183.aspx/1?p=True&t=635113963383381914).
If the layers/levels of indirection were stripped away, and a
straightforward connection between the view and the database were
possible, it would be child's play (so to speak) to update the relevant
tables with the needed data. I feel as if I'm piloting a 747 to the corner
store to pick up a loaf of bread. I could have crawled there and back
before I complete the preflight checklist.
Also, all this smoke and mirrors/fancy-pants abstraction reminds me of the
modern-day "efficiencies" of automated responses to phone calls. Yes, it's
more efficient (saves $ for the business!!!!), but 9 times out of 10 it's
a pain in the "ankle" for the customer. IOW, indirection and the
depersonalization of our lives is seen reflected all around us, including,
or maybe especially, in software -- both in its external effects and its
internal workings -- and I'm not at all convinced this is, all in all, a
"good thing."
There's a balance to be struck, no doubt; sometimes the 747 is needed. But
sometimes it just slows you down as you are bogged down in the mud of
trying to fit square pegs into trapezoidal holes.
So all that to say this: How can I bind the comma-separated values, which
I can get from the plugin via some jQuery, to my model's member?

No comments:

Post a Comment