dcsimg
Linux Today: Linux News On Internet Time.





O'Reilly Network: Design Patterns in Qt by Matthias Kalle Dalheimer

Jan 15, 2002, 15:06 (1 Talkback[s])
(Other stories by Matthias Kalle Dalheimer)
"The so-called GoF book Design Patterns (GoF referring to the Gang of Four -- Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides -- who authored it) has been very influential in software development--and rightfully so. Every programmer has read it or at least claims to have done so. In this article, I will explore how Design Patterns are used in Qt programming.

Design Patterns are a language-independent way of describing common patterns that occur again and again in programming. This is nothing new, patterns have been used for decennies, but the GoF book deserves the praise to have standardized how to describe patterns, give frequently used patterns names that developers all over the world refer to, and finally to have started a whole movement around patterns where developers identify new patterns and share them with each other. These names have become so common among software developers that it is not unusual to see magazine articles with titles like "How to Implement Observer in Programming Language X"-- it is not necessary to explain that Observer is the name of such a pattern, catalogized in the GoF book.

But let's leave the patterns aside for a moment and switch to Something Completely Different: the C++ GUI toolkit Qt. Qt is developed and marketed by the Norwegian company Trolltech and is available for Windows and various Unix dialects (and soon for the Macintosh). Qt follows the single-source paradigm: A program written with Qt can be compiled and run on any of the supported platforms without changes to the source code. Of course, reality sometimes trips you here, compiler bugs and incompatibilities (did I hear someone whispering MS Visual C++?) can make small adaptations necessary, and you cannot use any native API functions if you want to stay platform-independent. However, Qt still does a good job helping developers to write portable software. In recent years, Qt has become famous for forming the base of the KDE desktop , a free desktop for Unix systems that now is the default graphical desktop on most Linux distributions. Qt comes with extensive reference documentation; programmers' documentation is available by means of my O'Reilly book Programming with Qt, 2nd Edition."

Complete Story