Антология паттернов для конечных автоматов
От: Ikemefula Беларусь http://blogs.rsdn.org/ikemefula
Дата: 06.10.10 07:29
Оценка: 1 (1)
Собственно, аццкий пдф

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.95.838&rep=rep1&type=pdf

1 есть диаграма чуть всех возможных паттернов для автоматов
2 Для каждого паттерна указан источник(книга)
3 дано короткое описание особенностей реализации
4 разумеется есть список литературы, там даже есть ссылки на ПДФ !!!
5 многие книги из списка можно найти в Google Books и посмотреть хотя бы по отрывкам, например Three-level FSM

В принципе при некотором опыте реализации автоматов можно понять о чем речь даже из короткого описпания.

Пример описания

Subclassing State Machines [SC95]

Applicability
Object-oriented design that permits a design of complex state machines by incrementally
modifying and combining other independently designed state machines.
When State DP does not apply, because we would like to subclass State hierarchy to
handle new events without affecting the existing code.
Solution
Subclass concrete State classes to add more specialized behavior/event handling. To
handle these new events, the Context class needs to be updated to dispatch them to the
current State object. The State superclass is also modified to provide an empty default
implementation of these events.
Instead of returning a programmed constant (or reference to an object), return the next
state indirectly, by looking it up in the table called StateMap.
Consequences
™ Can add State subclasses that handle more events (i.e. extend the public interface)
without affecting existing State classes, while reusing the default handling of the
existing events.
™ StateMap lookup is similar to a virtual table lookup and does not increase the run-
time overhead.
; The Context class delegates all external events to corresponding methods in the
interface of the State class. It is responsible for providing the correct mapping. This
results in a tight coupling between the Context class and concrete events.
Related Patterns
State DP does not support adding new events to new classes without modifying all
classes in the State hierarchy.
State Action Mapper also uses a table, but fails to provide the ability to extend the
behavior this pattern provides, because it focuses on limiting the number of classes and
uses only a single class to model the state.
State with Exemplars provides a flexible FSM design by dynamically registering Event
and Target objects. Subclassing State Machines provides flexibility in the form of new
State subclasses that override the default behavior and default transitions in the StateMap
class.
FSM Framework does not support the subclassing of State classes, but provides even
more flexibility by encapsulating all FSM elements as classes.

 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.