Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. # Event driven development example
  2.  
  3. In this example, we have a dog and a human.
  4. * When the human feeds the dog; it eats, poops and barks.
  5. * When the dog poops, the human cleans.
  6.  
  7. When we use events to trigger actions, we can remove a direct dependency between all the components. It doesn't make sense that the Dog class needs a dependency on the Human and the Human class should not care about the Dog class. Also if we want to monitor all the action, we don't want to clutter the classes with a non business related logic.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement