7.3.  Frameworks and Components

[ fromfile: frameworks.xml id: frameworks ]

Abstract

Organization of classes goes beyond simple inheritance. Carefully designed frameworks enable you to find and reuse components much more easily. All large software projects are built on top of frameworks, and we discuss some of the more popular ones in use today.

Code reuse has high priority in modern programming. In the past, computer time was expensive and programmer time was relatively cheap, but now things are exactly reversed. Today all software is built out of building blocks, which are themselves pieces of software. You never start from scratch to develop an app. It is a waste of a programmer's time to reinvent and reimplement things that have already been designed, implemented, refined, and tested by recognized experts.

A framework is a (typically large) collection of general-purpose (or domain-specific) classes and conventions designed to improve the consistency of design. Frameworks are often used to create graphical applications, database applications, or other complex pieces of software.

A framework has a well-documented public Application Programming Interface, or API. An API is a description of the public functions, classes, and interfaces in a library. To implement frameworks, design patterns are used. Development with design patterns involves looking for pertinent objects and possible hierarchies. The classes and patterns used are given good descriptive names so that you can define them once and reuse them elsewhere. We discuss design patterns shortly in Section 7.4.

Qt is one of many open source object-oriented frameworks that provide a set of reusable components for building cross-platform applications. Some others worth knowing about are

With a multiplatform framework like Qt, you can gain enormous benefits from the creative efforts of others. Software built on top of (strictly using) Qt will be based on components that have already been tested on Windows, Linux, and Mac OS/X by thousands of programmers.

Toolkits like Qt (and also Gtk++, the cross-platform Gnu ToolKit) are implemented differently on each platform. This is why Qt-based applications look like KDE applications in Linux and like Windows applications in Windows.



[58] AJAX is an acronym for Asynchronous JavaScript And XML, a client-side system of JavaScript and XML-rpc that gives list/tree/table views with GUI behavior inside a web page.