Skip to content

Instantly share code, notes, and snippets.

@ben-biddington
Last active December 22, 2015 08:49
Show Gist options
  • Save ben-biddington/6447772 to your computer and use it in GitHub Desktop.
Save ben-biddington/6447772 to your computer and use it in GitHub Desktop.
Decomposing interactions by following the messages

###"I have something I'd like you to look at" This one looks more like procedural decomposition, TwitterHandle#valid? is a function operating on a data structure (string). the target does not "know" anything other than what is supplied as its argument.

validator = TwitterHandleValidator.new
 
TwitterHandleValidator.valid? "ben-biddington"

"Can I ask you a question?"

supplied with a true object, I can ask it questions.

handle.valid?

Can I introduce you to someone?

First I have to create a person to ask. Other than that, the same as the previous example.

text = "ben-biddington"

handle = TwitterHandle.new(text)

handle.valid? 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment