Chair of Software Engineering JMLC 2003, 26.08.2003, Klagenfurt Austria Event Library: an object-oriented library for event-driven design Volkan Arslan,

Slides:



Advertisements
Similar presentations
SCOOP: Simple Concurrent Object-Oriented Programming Extend the pure, strongly typed, object-oriented language Eiffel with a general and powerful concurrency.
Advertisements

Eiffel: Analysis, Design and Programming Bertrand Meyer (Nadia Polikarpova) Chair of Software Engineering.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 10: Advanced Object-Oriented Mechanisms (based on.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Exercise Session 1: Eiffel Introduction.
2 nd Microsoft Rotor Workshop, Pisa, April 23-25, SCOOPLI for.NET: a library for concurrent object-oriented programming Volkan Arslan, Piotr Nienaltowski.
SCOOP on.NET Volkan Arslan Chair of Software Engineering ETH Zurich, Switzerland
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Chair of Software Engineering 1 Introduction to Programming Bertrand Meyer Exercise Session November 2008.
Event-Driven programming, agents & tuples.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Chair of Software Engineering PPoPP 2003, , San Diego SCOOP it up! Piotr Nienaltowski Chair of Software Engineering, ETH Zurich, Switzerland.
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer.
Chair of Software Engineering OOSC Lecture 20 - Concurrency Object-Oriented Software Construction Bertrand Meyer.
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer.
Chair of Software Engineering ATOT - Lecture 24, 25 June Advanced Topics in Object Technology Bertrand Meyer.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Principles of Object-Oriented Software Development The language Eiffel.
Design Patterns CS is not simply about programming
Event-Driven programming, agents & tuples.
SCOOP: Simple Concurrent Object-Oriented Programming Piotr Nienaltowski, Volkan Arslan, Bertrand Meyer presented by: Mark Schall.
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Lecture 17: Event-driven programming.
James Tam Introduction To Design Patterns You will learn about design techniques that have been successfully applied to different scenarios.
Visual Basic: An Object Oriented Approach 11 – Patterns in object oriented programming.
Chair of Software Engineering ATOT - Lecture 25, 30 June Advanced Topics in Object Technology Bertrand Meyer.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 9: Contracts and Inheritance (based on work with.
Chair of Software Engineering 1 Introduction to Programming Tuples and Agents Exercise Session 1 and 2 December 2008.
The Template Method By Sinclair Schuller. What is the Template Method? “Skeleton” definition of an algorithm Allows redefinition of predetermined points.
Chair of Software Engineering ATOT - Lecture 20, 11 June Advanced Topics in Object Technology Bertrand Meyer.
Chair of Software Engineering ATOT - Lecture 2, 2 April Advanced Topics in Object Technology Bertrand Meyer.
Chair of Software Engineering OOSC - Summer Semester Object-Oriented Software Construction Bertrand Meyer Lecture 6: Genericity.
Chair of Software Engineering Software Architecture Prof. Dr. Bertrand Meyer Lecture 7: Patterns, Observer, MVC.
Chair of Software Engineering Updated: 04 April 2006 Lecture 1: Course overview and introduction Concurrent Object-Oriented Programming Bertrand Meyer,
Chair of Software Engineering OOSC - Summer Semester Object Oriented Software Construction Prof. Dr. Bertrand Meyer Last update: 7 May 2005 Lecture.
Chair of Software Engineering Object-Oriented Software Construction Bertrand Meyer Lecture 21: Agents and tuples.
Distributed Collaborations Using Network Mobile Agents Anand Tripathi, Tanvir Ahmed, Vineet Kakani and Shremattie Jaman Department of computer science.
Chair of Software Engineering ATOT - Lecture 7, 23 April Advanced Topics in Object Technology Bertrand Meyer.
ECE 355 Design Patterns Tutorial Part 2 (based on slides by Ali Razavi) Presented by Igor Ivković
Chair of Software Engineering OOSC - Lecture 18 1 Object-Oriented Software Construction Bertrand Meyer.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Behavioral Patterns  Behavioral patterns are patterns whose purpose is to facilitate the work of algorithmic calculations and communication between classes.
Robust Design Strategies I Gruia-Catalin Roman and Christopher Gill Washington University in St. Louis.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAM DESIGN WITH C++ Model View.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
Software Construction Lecture 10 Frameworks
Implementing Design Patterns Using Java St. Louis Java Special Interest Group Eric M. Burke Object Computing, Inc. Presented on July 9, 1998 (updated July.
Advanced topics in software engineering CSC532 Term Paper Design Patterns Harpreet Singh Submitted By:-
ISP666 MVC & Design Patterns. Outline Review Event Programming Model Model-View-Controller Revisit Simple Calculator Break Design Patterns Exercise.
DaveAndAl.net Do Application Design Patterns Make Sense in ASP.NET? Alex Homer You may like to write these down now...
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 27. Review UML dynamic view – State Diagrams.
Real Time Auction System Metex Systems Inc.. Inside the UML The Problem Auctioning in real time over the Web requires that many people connect and participate.
Behavioral Design Patterns Morteza Yousefi University Of Science & Technology Of Mazandaran 1of 27Behavioral Design Patterns.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
© Siemens AG, CT SE, Prashant Jain, October 15, 2001 C O R P O R A T E T E C H N O L O G Y OOPSLA 2001 Workshop Software & Engineering Architecture 1 A.
A Multi-agent Approach for the Integration of the Graphical and Intelligent Components of a Virtual Environment Rui Prada INESC-ID.
Manali Joshi1 The Observer Design Pattern Presented By: Manali Joshi.
Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAMMING PRACTICES Model View.
1 Unified Modeling Language, Version 2.0 Chapter 2.
1/18/2000STScI Software Workshop Object-oriented Design Elements of the OPUS Application Programming Interface Data Processing Team.
The Observer Design Pattern Author :Erich Gamma, et al. Source :Elements of Reusable Object-Oriented Software Speaker : Chiao-Ping Chang Advisor : Ku-Yaw.
Design by Contract Jim Fawcett CSE784 – Software Studio
Design by Contract Jim Fawcett CSE784 – Software Studio
SCOOPLI for .NET: a library for concurrent object-oriented programming
Presented by Igor Ivković
Advanced Program Design with C++
Advanced ProgramMING Practices
Advanced ProgramMING Practices
Presented by Igor Ivković
Presentation transcript:

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Event Library: an object-oriented library for event-driven design Volkan Arslan, Piotr Nienaltowski, Karine Arnout Chair of Software Engineering, ETH Zurich, Switzerland {Volkan.Arslan, Piotr.Nienaltowski,

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Overview  Motivation  Use of the Event Library  Example: Event Library in action  Architecture of the Event Library  Conclusion and future work

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Event-driven programming  Event-driven programming is very popular, especially for GUI applications  Facilitates the separation of concerns: application layer and GUI  Publish/Subscribe and Observer pattern follow the event-driven approach

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Event Library Make things as simple as possible, but not simpler. (A. Einstein) Turn the Observer pattern to a simple, reusable, but powerful library  Event Library

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Use of the Event Library Using the Event Library consists only of 3 steps: 1.PUBLISHER defines an event type 2.SUBSCRIBER subscribes a feature of an object to an event type 3.PUBLISHER publishes an event (of a certain event type)

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Example: Event Library in action

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Class SENSOR class SENSOR feature -- Access temperature: INTEGER -- Container temperature humidity: INTEGER -- Container humidity pressure: INTEGER -- Container pressure end -- class SENSOR

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Class SENSOR class SENSOR feature -- Access temperature: INTEGER -- Container temperature feature -- Element change set_temperature (a_temperature: INTEGER) is -- Set temperature to a_temperature. require valid_temperature: a_temperature > -100 and a_temperature < 1000 do temperature := a_temperature ensure temperature_set: temperature = a_temperature end end -- class SENSOR

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria (1) Publisher defines an event type class SENSOR feature -- Access temperature: INTEGER -- Container temperature feature -- Element change set_temperature (a_temperature: INTEGER) is -- Set temperature to a_temperature.... feature -- Events temperature_event: EVENT_TYPE [TUPLE [INTEGER]] -- Event associated with attribute temperature. invariant temperature_event_not_void: temperature_event /= Void end -- class SENSOR EVENT_TYPE [EVENT_DATA -> TUPLE] [40, 60] [25] [] conforms to

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria (2) Subscription to an event type In subscriber class MAIN_WINDOW Sensor.temperature_event.subscribe (agent application_window_1.display_temperature (?)) In the subscribed class APPLICATION_WINDOW display_temperature (a_temperature: INTEGER) is -- Update the text of temperature_value_label -- with a_temperature. do … end

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria (2) Subscription to an event type In class MAIN_WINDOW (Subscriber) Sensor.temperature_event.subscribe (agent application_window_1.display_temperature (?)) Class EVENT_TYPE subscribe (an_action: PROCEDURE [ANY, EVENT_DATA]) is -- Add an_action to the subscription list. require an_action_not_void: an_action /= Void an_action_not_already_subscribed: not has (an_action) ensure an_action_subscribed: count = old count + 1 and has (an_action) EVENT_TYPE [EVENT_DATA -> TUPLE]

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria (3) Publisher publishes an event class SENSOR feature -- Access temperature: INTEGER -- Container temperature feature -- Element change set_temperature (a_temperature: INTEGER) is -- Set temperature to a_temperature. require valid_temperature: a_temperature > -100 and a_temperature < 1000 do temperature := a_temperature temperature_event.publish ([temperature]) ensure temperature_set: temperature = a_temperature end feature – Events temperature_event: EVENT_TYPE [TUPLE [INTEGER]] end -- class SENSOR

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria (3) Publisher publishes an event class SENSOR … feature -- Element change set_temperature (a_temperature: INTEGER) is -- Set temperature to a_temperature. require valid_temperature: a_temperature > -100 and a_temperature < 1000 do temperature := a_temperature temperature_event.publish ([temperature]) ensure temperature_set: temperature = a_temperature end feature – Events temperature_event: EVENT_TYPE [TUPLE [INTEGER]] end -- class SENSOR Class EVENT_TYPE publish (arguments: EVENT_DATA) is -- Publish all not suspended actions from the subscription list. require arguments_not_void: arguments /= Void EVENT_TYPE [EVENT_DATA -> TUPLE]

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria (3) Publisher publishes an event class SENSOR … feature -- Element change set_temperature (a_temperature: INTEGER) is -- Set temperature to a_temperature. require valid_temperature: a_temperature > -100 and a_temperature < 1000 do temperature := a_temperature temperature_event.publish ([temperature]) ensure temperature_set: temperature = a_temperature end feature – Events temperature_event: EVENT_TYPE [TUPLE [INTEGER]] end -- class SENSOR Class EVENT_TYPE publish (arguments: EVENT_DATA) is -- Publish all not suspended actions from the subscription list. do do_all (agent {PROCEDURE [ANY, EVENT_DATA]}.call (arguments)) end EVENT_TYPE [EVENT_DATA -> TUPLE]

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Architecture Classification according to Eugster P. Th. [3]  Space decoupling The publisher and the subscribed class do not know each other  Flow decoupling Publishers should be not blocked, while publishing events  Time decoupling Publishers and subscribed objects do not have to participate actively in the interaction at the same time (e.g. distributed setting)

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Conclusion Event Library is simple to use  Consists of only one class EVENT_TYPE  Publisher, Subscriber and Subscribed object  Supports full event-driven programming  Type safe  For advanced needs, class EVENT_TYPE is extendible It relies on powerful language mechanism  Genericity (including constrained genericity)  Tuples  Agents  Inheritance

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Future work Extension of the Event Library  “Conditional Event subscription” possible when inline agents are introduced to the language  Use of concurrency (SCOOP) in order to obtain flow and time decoupling  Guaranteeing response times for subscribed objects when an event of a certain event type is triggered.  General publish-subscribe mechanism available as Web Service (time decoupling)

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria References 1.Arslan V.: Event Library, at 2.Eiffel Software Inc.: Agents, iteration and introspection, at Eugster P. Th., Felber P., Guerraoui R., Kermarrec A.-M.: The Many Faces of Publish/Subscribe, Technical Report at df df 4.Gamma E., Helm R., Johnson R., Vlissides J.: Design Patterns: Elements of Reusable Object-Oriented Software, 1st edition, Addison-Wesley, Meyer B.: The power of abstraction, reuse and simplicity: an object- oriented library for event-driven design, at Nienaltowski P., Arslan V.: SCOOPLI: a library for concurrent object- oriented programming on.NET, in Proceedings of the 1st International Workshop on C# and.NET Technologies, University of West Bohemia, 5-8 February 2003, Pilsen, Czech Republic.

Chair of Software Engineering JMLC 2003, , Klagenfurt Austria Questions ? Thank you for your attention!