Symbian3/SDK/Source/GUID-93086866-F6E1-5715-A3BE-EEACF8A760DB.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 15:24:34 +0100
changeset 9 59758314f811
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-93086866-F6E1-5715-A3BE-EEACF8A760DB"><title>Frameworks, Libraries and DLLs</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>Symbian platform C++ supports two fundamentally different ways of using DLLs, called polymorphic interface DLLs and static interface DLLs. This topic describes these types and for what purposes they are used. </p> <section><title>Types of DLL</title> <p>Like other modern object-oriented systems, the Symbian platform 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. </p> <p>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 on the Symbian platform, the new implementation is then built as what's known as a <i>polymorphic interface DLL</i>. 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. </p> <p>An alternative to polymorphic DLLs is supplied by the <i>ECom plug-in architecture</i>. This is a generic framework for specifying plug-in interfaces, and for calling and writing plug-ins. Newer Symbian platform 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. </p> <p> <i>Static interface DLLs</i> 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. </p> <p>The Symbian platform build environment is designed to minimise the complexity to Symbian 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 <codeph>plugin</codeph> type targets, and static interface DLLs as <codeph>dll</codeph> type targets. </p> </section> <section><title>Use of frameworks</title> <p>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. </p> <p>For most Symbian developers most of the time, therefore, working with the Symbian platform 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. </p> </section> </conbody></concept>