Bus

Why, How, What

Redundant?

To organize communication between entities that don't know each other

Why

How

Alan Key

Inventor of Smalltalk

Objects communicate by sending and receiving messages
bob = Bob.new

bob.fat?

Don't know the receiver

codetunes.subscribe(alice)
codetunes.subscribe(bob)
codetunes.release_post(post)

class Codetunes
  def initialize
    @subscribers = []
  end

  def subscribe(subscriber)
    @subscribers << subscriber
  end

  def release_post(post)
    # ...
    subscribers.each do |subscriber|
      subscriber
        .read_codetunes_post(post)
    end
  end
end

Don't know either receiver and publisher

Message in the bottle

sea = Sea.new

robinson.throw_buttle(target: sea)

alice.watch(sea) do |finding|
  if finding.respond_to?(:message_in_bottle)
    alice.decipher_message_in_bottle(finding)
  end
end

Requirements

  • Know the transportation layer
  • Know the message format

What

  • Command Bus
  • Event Bus
  • Motherboard
  • Distributed system

Resources

Recruitment

Made with Slides.com