Designing an event-based application