On Mon, 07 Jul 2008 06:59:21 -0700, shapper <md*****@gmail.comwrote:
[...]
In the View I have a form where I need to display the List in the CSV
format.
When I submit the form I need to convert that CSV data to a list
before I save it to the database using Linq.
[...]
How should I implement this and where to make the conversions? In the
View? In the Controller?
IMHO, there's no "right answer" to the question. Personally, I would
generally make the view responsible for all data conversions, inasmuch as
they are just different ways of looking at the model. But to some extent,
MVC is just something to use as your design guide. If in your situation
it works better or seems more appropriate for the controller part of your
code to handle data conversion of that nature, by all means do it that way.
A design pattern should be something that aids you. If it constrains you,
it should only do so in a beneficial way. If you find a design pattern
constraining you in a way that seems only detrimental, and you feel that
you can prove to yourself that it _is_ only detrimental, then ignore that
constraint.
If nothing else, you may find later that you were wrong, and you'll learn
something about why the constraint is important. And it could turn out
that you were right, in which case you'll have avoided a lot of headaches
trying to comply with an arbitrary, useless constraint. :)
Pete