You Are Here:

Community: Wiki

This page was last modified on 30 September 2009, at 14:41.

View Vs Container

From Forum Nokia Wiki

Reviewer Approved   

Most of the new people working for S60 are confused between views and containers.

Contents

The basic reasons for confusion

1) SDK examples

Most of the example applications name the CCoeControl-derived class View (maybe because they mean the generic term : View means representation of data, View may be derived from CAknView or from CCoeControl and its a generic term). To avoid confusion it should in fact be named Container because the view class that derives directly from CCoeControl should be called Container.

2) Lack of proper documentation

There is no straightforward documentation which explains what view and container are, what the basic difference between them is, and when each of them should be used.

What exactly is a view

  • In abstract terms, a view means representation of data.
  • If we talk in terms of classes, then a View class in S60 is derived from CAknView.
  • It is not an actual control.
  • It owns a Container control (derived from CCoeControl) to create its view.

What exactly is a Container

  • As stated above it is derived from CCoeControl.
  • It actually is a control, all the controls are derived from abstract base class CCoeControl.
  • It is a drawable control and may contain one or more controls.


Why do we need Views

  • Most of the normal applications don't need views ( derived from CAknView ).
  • You need views when your application has multiple screens that form complex navigational paths.
  • When you want to save data on every view switching, to update the model with the newly entered or updated data.
  • When you want to send data among screens or to external applications.
  • It handles switching of views, handling menu-commands, sending keyboard/pointer events to respective container class.


Why do we need a Container

  • Well certainly you may want to display some information on the screen, this is the class which will actually have access to screen. For example, you may want to display a list box or a query dialog for user input.
  • Most of the normal applications don't require view classes, container will satisfy the basic requirements.

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fHowE5ftoE5fcreateE5faE5fCountryE2dInfoE5fWidgetE5fE28WE52TE29X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxs60X qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ