16
Explore Patterns in Context- Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Embed Size (px)

Citation preview

Page 1: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Explore Patterns in Context-Aware Applications

--Using Reactor Pattern to Develop In/Out Board

Fall 2002

Yu Du

Page 2: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Outline

Motivation Pattern definition In / Out Board using Reactor Pattern

– Requirements– Design– Reactor Pattern– Screen shots

Conclusions

Page 3: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Motivation

Context-aware applications is complex. Patterns are a recent software engineering

problem-solving discipline. An attempt to describe good designs, and

capture experience for reuse. “The long term goal is to develop handbooks

for software engineers.”

Explore patterns in context-aware applications development.

Page 4: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

What is pattern

A pattern is a reusable solution to a recurring problem. Context Program structure Participants Consequences: both positive and negative Examples!

Page 5: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Pattern example

class Singleton { public:

static Singleton* Instance(); // gives back a real object! proof(void); // proof that the object was made protected:

Singleton(); // constructor private:

static Singleton* _singleton; };

Page 6: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

In/Out Board

Displays the in/out status of users Displays the day and time when the users last

entered/left the room Web-based application User-defined services will be triggered upon user’s

entering / leaving. – Turn on / off the lights – Pull out the seat– Turn on and log in the user’s computer– Coffee will be served

Page 7: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Architecture Design

Client(Web Browser)

User Info DB(MS Access)

In/Out EventSimulator

HTTP

RMI Main Server(Java programs)

Web Server(Tomcat, JSP)

JDBC

RMI

Page 8: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Main Server Design -- Reactor Pattern

For demultiplexing and dispatching handles for synchronous events.

Also known as dispatcher, notifier. Used in

– CORBA ORBs– InterViews– Ericsson EOS Call Center Management System– ACE Framework

Page 9: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Main Server Design -- Reactor Pattern

Page 10: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Reactor Pattern

Handles: identify resources Synchronous Event Demultiplexer: blocks awaiting

events to occur on a set of Handles. Initiation Dispatcher: an interface for registering,

removing, and dispatching Event Handlers. Event Handler: specifies hook methods Concrete Event Handler: implements the hook

method, as well as the methods to process these events

Page 11: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Reactor Pattern – General Collaborations

Page 12: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Pro’s & Con’s

Separation of concerns Improve modularity, reusability Improve application portability Provides coarse-grained concurrency control Non-preemptive Hard to debug

Page 13: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

User Interface

Page 14: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

User Interface -- Event Simulator

Page 15: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Conclusions

Patterns are useful for developing and documenting software.

Patterns repositories have been set up for– Distributed systems– Database systems– Fault tolerant systems…

More exploration on context-aware applications

Page 16: Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du

Questions?