Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Yeah, that's what I'll probably end up doing ! Thanks a lot, sir. Commented Nov 4, 2013 at 19:20
  • Well, I already assumed he already tried this, but didn't succeed. @alfa-alfa Commented Nov 4, 2013 at 19:35
  • @Euphoric: How do you "not succeed" in this? As Yoda would say: Do or do not, there is no try. Commented Nov 4, 2013 at 20:48
  • 1
    @Aaronaught For example he really needs all the data in single viewmodel. Maybe he has grid and different columns come from different services. You cannot do that with composition. Commented Nov 4, 2013 at 20:57
  • 1
    @Euphoric: Actually, you can solve that with composition, but that can be done beneath the view model level. It's simply a matter of creating the right abstractions. In that case, you only need one service to handle the initial query to get a list of IDs, and a sequence/list/array of "enrichers" which annotate with their own information. Make the grid itself its own view model, and you've solved the problem with effectively two dependencies, and it's extremely easy to test. Commented Nov 4, 2013 at 21:13