Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


Frameworks, libraries and DLLs

[Top]


Introduction

Symbian OS supports two fundamentally different ways of using DLLs. This underlies an important difference in the way that the types of DLL expose their interface to the system.

[Top]


Frameworks, libraries, and DLLs

Like other modern object-oriented systems, Symbian OS makes extensive use of frameworks. A framework is a software system that defines a collection of abstract base classes and ready-made concrete classes, and which is designed for extension. The framework is shipped as part of the operating system in one or more system DLLs. These DLLs are conventional static interface DLLs, which export functions that can be called by other code that builds against its header files and links against its import library.

To use the framework, a programmer derives a new implementation from its abstract base classes, providing new behaviour where required and making use of the default implementation otherwise. Traditionally in Symbian OS, the new implementation is then built as what's known as a polymorphic interface DLL. Instead of exporting a table of functions which require an import library in order to identify them correctly, a polymorphic interface DLL exports a single function only at a well known location. Calling this function creates an instance of the newly derived framework class.

From Symbian OS v7.0, an alternative to polymorphic DLLs is supplied by the ECom plug-in architecture. This is a generic framework for specifying plug-in interfaces, and for calling and writing plug-ins. Newer Symbian OS frameworks, such as those for SyncML and for the Transport Architecture, require plug-ins to be written using ECom, rather than polymorphic DLLs. Such frameworks delegate finding and instantiating suitable plug-in objects to ECom, rather than managing these tasks themselves.

Static interface DLLs are also known as shared library DLLs. As well as providing system APIs, they also have a place in applications programming. In a complex project, abstraction and modularisation can be achieved by designing a system as a collection of separate units, each of which encapsulates a piece of the logical design and provides it as a black box to the rest of the system. Each unit is known to others only by its API, and is built as a library DLL.

The Symbian OS build environment is designed to minimise the complexity to developers of working with multiple program types. Every project is fully specified by its project file, and makefiles are generated from project files by the toolchain. Correctly declaring the target type in the project file will ensure the correct build process and generate an appropriate target. Thus, ECom plug-ins are built as as plugin type targets, and static interface DLLs as dll type targets.

[Top]


Use of frameworks

Frameworks are a natural extension of the programming style which encourages memory efficient code reuse by implementing system APIs in DLLs. (In contrast, older systems require that object code libraries be linked in statically with every executable which uses them.) Frameworks take the notion of an API a step further and provide both architecture and ready-made building blocks for re-use. This makes them well suited to OO systems.

For most developers most of the time, therefore, working with Symbian OS means working with frameworks. This includes all programs which use the Application Architecture or the UIKON GUI framework. It also includes more specialist programming, including printer driver and device driver implementation, as well as writing new hardware abstractions to extend existing subsystems like comms or telephony, and implementing new protocols to extend the networking subsystem.