Symbian3/SDK/Source/GUID-BDDDF68F-F7C3-43AF-8B6C-C77C701FD2A9.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-BDDDF68F-F7C3-43AF-8B6C-C77C701FD2A9" xml:lang="en"><title>Framework
       
    13 requirements for GUI applications</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>Applications developed for the Symbian platform can use a number of
       
    15 different architecture solutions to meet their requirements. One example of
       
    16 a common approach includes the Model - View - Controller (MVC) pattern used
       
    17 in GUI-based applications. In this approach, the application is split into
       
    18 three separate logical parts. Each part contains a different aspect of the
       
    19 entire application, and has a specific role.</p>
       
    20 <fig id="GUID-5E3A844B-CCF3-4F2A-82A9-DA7A5B65A572"><title>Logical dependencies in the MVC pattern</title><image href="GUID-A5E152B2-F15C-4809-A52A-BCDDBCD93255_d0e41998_href.png"/></fig>
       
    21 <p>In this approach, the model:</p>
       
    22 <ul>
       
    23 <li><p>contains and manipulates the data in the application</p>
       
    24 </li>
       
    25 <li><p>is owned by the controller</p></li>
       
    26 <li><p>is typically implemented in its own class or classes</p>
       
    27 </li>
       
    28 </ul>
       
    29 <p>the <xref href="GUID-DAC32BB9-C0EB-42FF-A596-C2F1A90A4BD7.dita">view</xref> :</p>
       
    30 <ul>
       
    31 <li><p>displays the application state known by the model</p>
       
    32 </li>
       
    33 <li><p>receives user input</p></li>
       
    34 <li><p>notifies the controller of relevant events</p></li>
       
    35 <li><p>is implemented either with a <parmname>CCoeControl</parmname> derived
       
    36 class or a <parmname>CAknView</parmname> derived class.</p><p>For more
       
    37 information on these options, see <xref href="GUID-B5DE1C86-2B16-4B22-887F-7079E54A8ED6.dita">Traditional
       
    38 Symbian UI application architecture</xref> and <xref href="GUID-68B999C2-0993-4804-9624-42C3D88BE5C7.dita">View
       
    39 architecture</xref>.</p></li>
       
    40 </ul>
       
    41 <p>the <xref href="GUID-FD2CDEB8-0784-4BE5-A775-170F57D71BBC.dita">controller</xref> :</p>
       
    42 <ul>
       
    43 <li><p>handles application-wide events</p></li>
       
    44 <li><p>commands the model, typically based on user input</p>
       
    45 </li>
       
    46 <li><p>selects the view to be displayed</p></li>
       
    47 <li><p>is implemented either with a <xref href="GUID-77329067-34D9-3698-B764-294535E660EB.dita"><apiname>CAknAppUi</apiname></xref>-derived
       
    48 class or a <xref href="GUID-2DBA2DA9-3DA7-381C-842C-9F6FEEDF973E.dita"><apiname>CAknViewAppUi</apiname></xref> derived class.</p><p>For
       
    49 more information on these options, see <xref href="GUID-B5DE1C86-2B16-4B22-887F-7079E54A8ED6.dita">Traditional
       
    50 Symbian UI application architecture</xref> and <xref href="GUID-68B999C2-0993-4804-9624-42C3D88BE5C7.dita">View
       
    51 architecture</xref>.</p></li>
       
    52 <li><p>requires the implementation of <xref href="GUID-4F825D83-47A4-36C9-9A25-943A6D799F84.dita"><apiname>CAknApplication</apiname></xref> and <xref href="GUID-935C59EE-AD66-33FE-987B-BD97F5147CC1.dita"><apiname>CAknDocument</apiname></xref> derived
       
    53 classes.</p></li>
       
    54 </ul>
       
    55 <p>The pattern is implemented with the following classes.</p>
       
    56 <fig id="GUID-B4508A88-B688-4BB7-B42A-31BFF41CD4FA"><title>Relationship between the classes that make up a typical Symbian application</title><image href="GUID-36BB14BD-34B3-4F5D-A670-707710E57585_d0e42116_href.png"/></fig>
       
    57 <p>The <xref href="GUID-4F825D83-47A4-36C9-9A25-943A6D799F84.dita"><apiname>CAknApplication</apiname></xref>-derived class:</p>
       
    58 <ul>
       
    59 <li><p>provides the application object expected by the application
       
    60 framework when the application is launched.</p></li>
       
    61 <li><p>defines the application properties.</p></li>
       
    62 <li><p>creates the <xref href="GUID-935C59EE-AD66-33FE-987B-BD97F5147CC1.dita"><apiname>CAknDocument</apiname></xref> derived class
       
    63 if it does not exist yet.</p></li>
       
    64 <li><p>if an instance of the application is already running, switches
       
    65 to that instance and exits.</p></li>
       
    66 </ul>
       
    67 <p>The <xref href="GUID-935C59EE-AD66-33FE-987B-BD97F5147CC1.dita"><apiname>CAknDocument</apiname></xref>-derived class:</p>
       
    68 <ul>
       
    69 <li><p>creates the controller class</p></li>
       
    70 <li><p>is the base class for application documents</p></li>
       
    71 </ul>
       
    72 </conbody></concept>