Chapter 2. Design

Table of Contents

General design
Final design
Tutorial classes
Modelling conditions
Steps of a tutorial
Managing the tutorial flow
Final design
Tutorial management
Managing the tutorials
Setting up KTutorial
Final design
Scripting
Specialized classes
Main interface for scripts
Managing the scripted tutorials
Final design
View
Tutorials view
Tutorials management view
Final design

Note

This design section is painfully outdated (most is still valid, though, although several components are missing from the explanation). However, the UML diagrams for the library and the UML diagrams for the editor from the Development section in the KTutorial webpage are up to date to the latest KTutorial release.

KTutorial design is explained next. First, a general view of the framework will be shown, and then each of the areas it is composed of.

Note that this design reflects the current state of development of KTutorial, and it doesn't include anything not implemented yet.

Qt's signal and slots terminology is used throughout this document. They are like a Observer design pattern (but on steroids, as it is a lot more powerful). The signal would be emitted by the Observable object and the slot would be called in the Observer when the signal is emitted.

There are several differenced parts in KTutorial. Each part contains a set of classes related to the classes of its same module, and almost without any relation with the classes from other modules. Those modules are: tutorials, tutorial management, scripting and view.

Tutorials module is the core of KTutorial and is composed by the classes used by developers to code new tutorials. Tutorial, Step and WaitFor are the most important classes in that module.

Tutorial management ensures that several tutorials can be used in the same application, and controls when they are started. This module also has the responsibility to setup KTutorial in applications using the library. The most important classes are TutorialManager and KTutorial.

Scripting module takes care of scripted tutorials related stuff, like specializing the behaviour of some classes or settin up the Kross environment. The most important classes are ScriptManager and ScriptingModule.

The last module is the view. KTutorial follows a Model-View architecture, being the other modules the model, and this one containing all the classes related to the (graphical) user interface. The most important classes are the TutorialManagerDialog and the TutorialWidget.