April 25, 2006

In this issue:

  • Getting Started with Statecharts
  • Quantum Leaps at the ESC Silicon Valley'06
  • Changes in Quantum Leaps Website
  • The Dual Licensing Bargain Explained

Getting Started with UML Statecharts

A lot of people approach me lately with the question: "I'm tired of spaghetti-code, but how can I get started with statecharts?".

Here is the step-by-step guide:

  • First, you need to understand why the traditional approach to event-driven programming (the event-action paradigm) is doomed to degenerate into spaghetti. Read the article "Who Moved My State?".
  • Next, you need to pick up the basics of state machine design and implementation. Read the article "Back to Basics".
  • At this point, you're ready to tackle the real thing. Download the "QEP/C Programmer's Manual", if you're a C programmer, or "QEP/C++ Programmer's Manual", if you prefer C++. Download the accompanying open source code.
  • Now is the hard part: you need to actually run the examples discussed in the "QEP Programmer's Manual". As you execute the examples, you should correlate the state machine responses (typically printed to the screen) with the corresponding state diagrams in the Manual. That way you'll pick up the UML notation quickly. Also, please set breakpoints in various parts of the code (an entry action, initial transition, internal transition, regular transition, etc.) and inject events such that your breakpoints will be hit.
  • After this, you are ready to design and implement your own statechart. If you don't have ideas from your problem domain, you can implement the PEdestrian LIght CONtrolled (PELICAN) crossing described in the article "Dèjà Vu".
  • If you're that far, I hope you're hooked and the worst is behind you. However, you still don't know how to combine multiple concurrent state machines into applications. Here is where the Quantum Framework (QF) comes in. You need to download the "QF/C Programmer's Manual", if you're a C programmer, or "QF/C++ Programmer's Manual", if you prefer C++. Download the accompanying open source code.
  • By now I hope you know the drill. You need to execute the QF example (the Dining Philosophers Problem). This example shows you how to pass events, how to handle time, and how state machines can share the CPU.
  • When you finish all this, you are almost ready to go on your own. I would recommend you start with a smaller project, because now you know just enough to be dangerous.

Quantum Leaps at the ESC Silicon Valley'06

ESC Embedded Systems Conference Silicon Valley'06 was a big success for Quantum Leaps™, LLC. Well over 100 attendees came to the "Practical Statecharts in C/C++" class presented by Miro Samek. Even more visitors stopped by the Quantum Leaps booth, including Jack Ganssle, Jean Labrosse, Michael Barr, members of the press, and many others.

Changes in Quantum Leaps Website

The Quantum Leaps website has been somewhat reorganized. Specifically, the Quantum Development Kits (QDKs) have been moved to the Products section. Also, the Downloads section now contains a page for GPL-only contributions derived from the open source Quantum Leaps software.

The Dual Licensing Bargain Explained

As you can see from the GPL-only Contributions page, there have been very little open source contributions so far. I'm not sure if this is an indication of the failing dual-licensing model, or simply misunderstanding of GPL and confusing open source with freeware.

So, let me repeat here quickly the rules of the game. GPL in Section 2[b] requires you to contribute any derivative works (such as your applications based on QEP, QF, QK, or QS) back to the open source community. If you fail to do so, you infringe on the license and lose all the rights granted you by the GPL.

However, because Quantum Leaps, LLC owns all the intellectual property (IP) in the software, we can license the software under any terms we choose. We have chosen to offer also traditional commercial licensinig, designed specifically for customers who want to retain the proprietary status of their code and therefore cannot use our products under GNU General Public License. The customers who license Quantum Leaps software under the commercial licenses do not use the software under the GPL and therefore are not subject to any of its terms.

All this establishes the fair rules of the game, known as the quid pro quo principle (something for something). You are welcome to use the code free of charge under the terms of the GPL, but then you are obligated to release your derivative works back to the open source community. Or, you can choose to use the software under one of the cost-effective commercial licenses, but then you contribute license fees to Quantum Leaps, which fuel further development of the software. Either way the whole community benefits.

Let me finish with the following quote from the recent book Embedded Systems Design on a Shoestring by Lewin A.R.D. Edwards (Newness, 2003):

With the plethora of useful open-source code floating around the Internet, free for the downloading, there might be a temptation simply to download and use whatever you please and assume that nobody will ever know because nobody will ever see your source code. Even ignoring the moral issues, this is suicidal folly. Anything from a disgruntled (or simply talkative) staff member to an interested hacker to a competitor reverse-engineering your product will destroy your company; discovery is inevitable, particularly if your product turns out to be a success. At the time of writing, several major American corporations are writhing in the throes of government investigations into accounting fraud; if your major product contains plagiarized code, discovery will lead to similar consequences. Worse—and this also applies to privately held companies, because it's not just stock price issue—you may be unable to ship any more units without an expensive major re-write of your operating system. Don't take this kind of risk. If you use free code, honor the license."

Embedded Systems Design on a Shoestring, page 50.



SUBSCRIPTION INFORMATION: You have received this emal because you have contacted Quantum Leaps or specifically elected to receive news from Quantum Leaps. To make sure you continue to receive this Newsletter in your e-mail inbox, and that it is not sent to bulk or junk folders, please add news@quantum-leaps.com to your address book.

If you no longer wish to receive e-mail from Quantum Leaps, please unsubscribe at: quantum-leaps.com/news or reply to this e-mail with the word "unsubscribe" in the subject or body of the message.

If you have been forwarded this newsletter and would like to receive it directly, please also visit quantum-leaps.com/news to subscribe.