Skip to main content link. Accesskey S
  • Anonymous
  • Log on
  • Help
  • IBM logo
  • IBM Web Experience Factory wiki
  • All Wikis
  • Home
  • Community Articles
  • Product Documentation
  • Learning Center


Search

Advanced Search

Categories

Tag Cloud

  • 6.1
  • 6.1.2
  • 6.1.5
  • 6.1.5.1
  • 7.0
  • Ajax
  • Alerts
  • Annotations
  • attachment
  • best practices
  • BlackBerry
  • builder
  • builder faq
  • builders
  • charts
  • Code samples
  • Connections
  • css
  • Custom builder
  • CustomBuilder
  • dashboard
  • Data Access
  • data access faq
  • Data and variables
  • Database
  • Databases
  • Debugging
  • demo
  • demo models
  • demo projects
  • demo widget
  • demos
  • deployment
  • deployment faq
  • Deployment scenarios
  • development
  • dojo
  • Domino
  • faq
  • fixpack
  • General FAQ
  • getting started
  • Help
  • HTML
  • html templates
  • ILOG
  • integration
  • iPhone
  • JViews
  • Learning
  • Logging
  • lotus connections
  • Lotus Widget Factory
  • media dashboard
  • media pf
  • media widget
  • mobile
  • mobile smartphone development
  • Model development
  • new
  • Notifications
  • overview
  • page automation
  • Portal
  • Portal Integration
  • portal integration faq
  • Portlet
  • Portlet Factory 7
  • presentation
  • presentation faq
  • Profiling
  • Quickr
  • REST
  • rest faq
  • REST Service Call
  • restructure handler
  • rich ui
  • sample
  • sample application
  • samples
  • schema
  • Security
  • Smartphones
  • SOA
  • social
  • Source Control
  • sql
  • summary and drilldown
  • Team development
  • Troubleshooting
  • ui
  • User Interface
  • video
  • web 2.0
  • Web Experience Factory
  • Web Experience Factory 8
  • Web Services
  • websphere dashboard framework
  • wef
  • wpf
InformationInformation
You are currently viewing machine translated content. IBM translation might be available. Click IBM Translated Product Documentation to see what is available.X


Home > Best Practices for Web Experience Factory > Leveraging the Model Container Builder
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Leveraging the Model Container Builder 

expanded Abstract
collapsed Abstract
No abstract provided.
ShowTable of Contents
HideTable of Contents
  • 1 Overview
  • 2 Events
  • 3 ModelInitializationData


The model container builder is probably one of the least used yet most valuable builders provided by WPF. This article explores how to design an application to take advantage of it. As the name suggests, this builder has the ability to contain other models within it and switch out those models dynamically. We can take advantage of this feature to build a series of screens that the user navigates through while keeping the models separate, as opposed to using the imported model builder which generates one monolithic super model.
 

Overview

 
We want to create a CRUD (create,read,update,delete) application for some contact information using the model container builder and some events. Each of the CRUD features will be implemented in its own model, and each will be executable on its own with a main action list. The model container will swap out each of these models based on events which are fired to indicate the next navigation page.

Sequence Diagram:
 event sequence diagram
 

Events


The model container will dynamically swap out/in the appropriate model based on events fired and trapped(see above diagram). Events are declared in a separate model and imported into the controller, readItem, editItem and listItems models. By firing events instead of directly requesting a page we don't have to keep a reference to the page (by importing the model which contains the page). This helps to keep everything tidy.

ModelInitializationData


A key component to making this approach work is a special variable named ModelInitializationData which is used to pass data from the model container to the child container. This can be observed in the event handlers' action list:

 
modelContainer.setModelName(DsixE/ModelContainer/readItem)
modelContainer.callInitializationAction(${Arguments/uid},true)
pageMC
 


The first line in the action list uses the LJO from the model container to tell it which model to load. The second line tells it what value to store in the ModelInitializationData variable, in this case the unique id that identifies which record we're interested in reading.
 
controller Model:
controller model builders


The child model contains a declaration for ModelInitializationData and uses that value in its main action list to retrieve data from the service consumer. The child model also contains buttons/links that will fire appropriate events telling the controller what to do next.
 
readItem Model:
readItem model builders

The nice thing about this approach is that everything is kept isolated, each model can execute on its own based on whatever value is populated in the ModelInitializationData variable and several developers can work concurrently without stepping on each others code.
 
Download the models discussed in this article


expanded Article information
collapsed Article information
Category:
Best Practices for Web Experience Factory, Best Practices,
Tags:
model container

This Version: Version 7 January 13, 2011 4:09:45 PM by Carl D  

expanded Attachments (3)
collapsed Attachments (3)

 


File TypeSizeFile NameCreated On
image/x-png 13 KB model container.png 12/7/10 5:51 PM
image/x-png 11 KB controller.png 12/7/10 5:51 PM
image/x-png 11 KB readItem.png 12/7/10 5:51 PM
expanded Versions (7)
collapsed Versions (7)
Version Comparison     
Version Date Changed by               Summary of changes
This version (7) Jan 13, 2011 4:09:45 PM Carl D   cleanup
6 Dec 8, 2010 4:00:13 PM Carl D   why doesn't this wiki have preview?
5 Dec 8, 2010 3:51:21 PM Carl D   formatting
4 Dec 8, 2010 3:42:41 PM Carl D   Minor change
3 Dec 8, 2010 3:33:51 PM Carl D   second draft
2 Dec 7, 2010 6:18:41 PM Carl D  
1 Dec 7, 2010 5:51:45 PM Carl D   draft
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedSubscribe to RSSHelpAbout
  • All Lotus and WebSphere Portal wikis
  • IBM developerWorks
  • IBM Software support
  • IBM Social Business User Experience Blog
  • IBMSocialBizUX on Twitter
  • IBMSocialBizUX on Facebook
  • Lotus product forums
  • IBM Social Business UX blog
  • IBM Collaboration Solutions
  • Recently added feedRecently added
  • Recently edited feedRecently edited
  • Recently added comments feedRecently Added Comments
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Contact IBM
  • IBM Terms of use
  • Wiki terms of use