zzz6519003 / blog

My blog about coding
4 stars 1 forks source link

learning MVVM #10

Open zzz6519003 opened 10 years ago

zzz6519003 commented 10 years ago

I'm currently in a entrepreneur-level app development, and I know what shitty code looks like. And then I hear the news that we might go a little about TDD. Then I think it's screwed, how can you test this crappy thing? I see this thing, MVVM, then I think It might be a good time to throw out some weights for our CONTROLLER. A fat controller brings us the Massive View Controller. Since the view & view controller is so close, why can't we just let them be together. Here's our problem. Our controller contains too much logic, and actually at the beginning, what i heard from the handsome Stanford old man is, the controller just take the model, and show the view. The thing is that Our model is always a JSON or something like, we don't actually simply take it and display it. We need to do a lot of crappy things on it, then have a Jelly, display the Jelly. And those logic of producing the Jelly can be away from our VC, therefore away from our view, therefore making it more testable.

zzz6519003 commented 10 years ago

Since now we have Reactive Cocoa, now we can simply bind those VM to views.