Interaction patterns for open systems