Good paper on Event-Driven Programming

Open-AT is an Event-Driven system, and many newcomers find this concept hard to grasp.

I recently found this paper which gives a good description of Event-Driven programming in general (nothing specifically to do with Open-AT):

Event-Driven Programming: Introduction, Tutorial, History
Stephen Ferg, January 2006.

eventdrivenpgm.sourceforge.net/

The Headerless Handlers and Observer patterns are particularly applicable - and the paper gives a good illustration of the “Subscription” metaphor that is so widely used by Open-AT…

Note that the paper does treat everything in Object-Oriented terms. Open-AT isn’t exactly “Object Oriented”, but that doesn’t detract at all from the general principles.

Hope some find it useful…

Hiya,

Good find!

Thanks - it’s being emailed to my programmers now.

ciao, Dave

I think Wavecom ADL develop team used WIN32 API concepts and added subscribe/publish terminology. There were many Win32 programming (message-driven) books in 1990’s. Therefore, if OAT (ADL) app developers have Win32 programming skills, I am sure OAT programming is a piece of cake for them. If someone would like to use C++ to development OAT app, I recommend to read Design Pattern (a Bible for C++ app developers) written by GANG OF FOUR in 1994.

I really would like to see the next ADL release will change some design architecture for C++ wrapper convenience, such as, adding context for all callback functions, just like WIN32 API does.

Actually, I doubt that they specifically took the Windows API; rather, they took the same general concepts that Windows uses.

But, yes: Windows GUI programming is very much event-driven - so people familiar with Windows GUI programming should have no trouble with the “Event Driven” paradigm…

State Machines for Event-Driven Systems
by Miro Samek:
netrino.com/Embedded-Systems … en-Systems

Coding State Machines in C and C++
by Miro Samek:
netrino.com/Embedded-Systems … e-Machines

Edit, 12 October 2012:

Since Netrino became Barr Group, the links are now:

barrgroup.com/Embedded-Syste … e-Machines

barrgroup.com/Embedded-Syste … en-Systems

This Whitepaper (with accompanying source code) gives a very good example of applying a State Machine design:

visualgps.net/WhitePapers/NM … arser.html

The specific problem addressed is the decoding of GPS NMEA Sentences.

In particular, note that this also illustrates how to accept data in arbitrary “chunks” that do not necessarily correspond to complete “messages” (NMEA Sentences, in this case) - which is exactly what happens when receiving data via FCM.

See: viewtopic.php?f=7&t=3766&p=23393#p23393
And: viewtopic.php?f=7&t=3766&p=23393#p23261

Discusses Event-Driven programming, and why State Machines are often a very good “fit” for such tasks.

Provides an example of the type of mess that’s all too easy to get into by doing Even-Driven programming without State Machines:

embedded.com/design/prototyp … nes-Part-1

Part 2 looks at extensions provided by UML to the basic State Machine concept

And so is Legato:

legato.io/legato-docs/14_04/ … asics.html