tags:

views:

37

answers:

1

I'm working through Josh Smith's code and article on CommandSink which is a solution that simplifies using commands in an MVVM context, seems very useful.

But I feel I am missing something about the concept by not understanding what the word "sink" is referring to, e.g.

  • the commands sink past the code behind into the ViewModel?
  • the commands are in a collection as e.g. dishes are in a sink?
  • or is this a play on words with keeping the View and ViewModel in sync?
+1  A: 

I think the proper metaphor is related to the way "ground" is used with electrical charge, in electronics. A "sink" is generally an entity responsible for the final reception and cleanup of whatever it is it is sinking.

This means the commands, in this case, don't continue to be used in the system after reaching the sink, it's the end of the line.

I think this entry is relevant, but reading down the list of disambiguations is illustrative too.

unwind
interesting, from the wiki article: "a black hole is where everything gets sucked in and the sink is where it all gets spit out at the other end"
Edward Tanguay