State Machine Mechanism

Views:
 
Category: Others/ Misc
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Slide 1: 

Random Logic l Forum .NET l 2006 1 State Machine Mechanism Forum .NET 1st Meeting ● December 27, 2005

Agenda : 

Random Logic l Forum .NET l 2006 2 Agenda State Machine Definition Why do we need it? The General State Machine Library Using the Machine Summary

State Machine Definition : 

Random Logic l Forum .NET l 2006 3 State Machine Definition In general, a state machine is any device that stores the status of something at a given time and can operate on input to change the status and/or cause an action to take place when status is changed

State Machine Definition cont. : 

Random Logic l Forum .NET l 2006 4 State Machine Definition cont. A state machine can be described as: An initial state or record of a generic object A set of possible input events A set of new states that may result from the input A set of possible actions or output events that result from a new state

Why do we need it? : 

Random Logic l Forum .NET l 2006 5 Why do we need it? Generic method to navigate through a module independent process graph dynamically configure a process graph Very easy to add new states to the process

The State Machine Library : 

Random Logic l Forum .NET l 2006 6 The State Machine Library Concept: Start from first node (state) in graph. Create the state using a Factory. Call its Handle() method and get the result in return. If state type is final – finish. If not final - Based on the result, get the next node in graph (and loop).

The State Machine Library : 

Random Logic l Forum .NET l 2006 7 The State Machine Library Internal Singleton 2

The State Machine Library cont. : 

Random Logic l Forum .NET l 2006 8 The State Machine Library cont.

The State Machine Library cont. : 

Random Logic l Forum .NET l 2006 9 The State Machine Library cont. View Code 1

Using the Machine : 

Random Logic l Forum .NET l 2006 10 Using the Machine The Process: Search Available Book in a library The Entities: Library, Book, BookCopy, SearchRequest Enter Book Title Check that title exists (State 1) Check that copy available (State 2) UI Logic Machine

Using the Machine : 

Random Logic l Forum .NET l 2006 11 Using the Machine UI Logic State Machine

Using the Machine cont. : 

Random Logic l Forum .NET l 2006 12 Using the Machine cont. View Code 2

Using the Machine cont. : 

Random Logic l Forum .NET l 2006 13 Using the Machine cont. The Process: Search Available Book in a library The Entities: Library, Book, BookCopy, SearchRequest Enter Book Title Check that title exists (State 1) Check that copy available (State 2) Assign copy (State 3)

Using the Machine cont. : 

Random Logic l Forum .NET l 2006 14 Using the Machine cont. Adding New State Actions: Create new class which implements the IState Interface (AssignBookState) Add State to configuration file Add node to Graph in configuration file

Using the Machine cont. : 

Random Logic l Forum .NET l 2006 15 Using the Machine cont. View / Add Code 3

Summary : 

Random Logic l Forum .NET l 2006 16 Summary The State Machine library manages a generic process based on configuration file. Using the Interfaces, a specific client can declare states and data, and let the machine manage the process itself. Addition of new state to a process or changing the order of existing states in a process becomes a very simple task. Defining specific order to specific cases in a process, is a simple task as well.

State Machine Mechanism : 

Random Logic l Forum .NET l 2006 17 State Machine Mechanism Thank you!

authorStream Live Help