I am wondering if itβs worth trying to make a presentation that accepts a general presentation model?
I am interested because someone mentioned that he had to do a lot of duplicate code, unless he started to create a general view and a general representation model.
Thus, basically the views will look like a set of controls. One view can have 2 controls (for example, a text box and a radio button), another view can contain 50 controls.
All of them will have the same appearance (it just grows in the number of controls). Basically, he thought that the view model takes an object (domain object), looks at it and sees 50 fields and displays the correct control types.
I suggest that an editing template can be used to define controls, but I'm just not for sale on a general presentation model.
I like generics, and they can do very powerful things, and in some situations they are good, but I'm just not that crazy of them and try not to use.
I find that most of the time it can reduce duplicate code, but sometimes it makes the code a lot more complicated. Of course, this can only be because I'm still relatively new to programming, and it can be even higher than my skill level.
, , , , , , .
, , , , , . .