External messages are any messages sent to objects other than self. External messages are a dependency because the object needs to know the name of a message that other object will respond to.
class Comment attr_reader :body, :post def initalize(body, post) @body = body @post = post end def capitalize_body body.upcase end def post_title post.title end end post = Post.new(title: "hi may name is someone") comment = Comment.new(body: "this is a cool post", post: post) # example of a message sent to self comment.capitalize_body
The Comment#capitalize_body method sends a message to self. The Comment#post_title message sends the title message to the post object and depends on the post object to be able to respond to the title message. External message dependencies often cannot be avoided, but are still real dependencies that should be monitored and occasionally isolated into separate methods.