Вы находитесь на странице: 1из 65

Welcome to

The Next Level


BlackBerry Technical Seminar 2007

MDS Studio

Mark Sohm
Welcome to
Topics The Next Level
BlackBerry Technical Seminar 2007

•What is BlackBerry MDS Studio?

•Overview
•MDS Application Framework Topology
•Learning MDS Studio

•Parts of an MDS Runtime Application:


•Data Components
•Screen Components
•Message Components

•Database Connector
•Introducing the Database Connector
•Working with the Database Connector
Welcome to
What is BlackBerry MDS Studio? The Next Level
BlackBerry Technical Seminar 2007

What is BlackBerry MDS Studio?


Welcome to
What is BlackBerry MDS Studio? The Next Level
BlackBerry Technical Seminar 2007

BlackBerry Mobile Data System Studio is a rapid application


development environment to build applications for BlackBerry
smart-phones
Welcome to
What is BlackBerry MDS Studio? The Next Level
BlackBerry Technical Seminar 2007

MDS Studio creates MDS Runtime Applications

MDS Runtime Applications are able to:


•Connect to a Web Service
•Connect to a Database Server

MDS Runtime Applications are published to a BlackBerry


Enterprise Server and available to users on that server.
•Installable by Users
•Pushed by Administrators
Welcome to
What is BlackBerry MDS Studio? The Next Level
BlackBerry Technical Seminar 2007

The Mobile Data System provides an optimized application


development framework for BlackBerry
Three key components of the rapid application platform:
•BlackBerry MDS Studio
• Allows developers to efficiently design wireless applications connected to
various data sources

•BlackBerry MDS Runtime Environment


• Provides a set of services to MDS Studio applications

•BlackBerry MDS Services


• Handles requests from BlackBerry MDS Studio applications and interfaces
with enterprise data sources and systems
Welcome to
Overview The Next Level
BlackBerry Technical Seminar 2007

Overview
Welcome to
MDS Application Framework Topology The Next Level
BlackBerry Technical Seminar 2007

MDS Studio Application


BlackBerry MDS Studio
• Visa
• Amex design

analyze
deploy
publish
Application Application
Registry …….
Repository Enterprise
…….
Smart-phones ……. Applications and Data
with BlackBerry
SAP
MDS Runtime
Siebel
Internet
MS .Net
BES and
BlackBerry Oracle
MDS Services
Welcome to
No Java? No Problem. The Next Level
BlackBerry Technical Seminar 2007

XML + JavaScript = MDS Runtime Applications


Every step in the development, deployment and management
process has been designed to be efficient and intuitive

•Graphical screen editor


•Built-in connectors for Database and Web Service integration
•Visual Database Operation designer
•Automated generation of data and messages
•No complex middleware for simple applications
•Abstracted services for persistence, user interface, messaging
Welcome to
What is the learning curve? The Next Level
BlackBerry Technical Seminar 2007

MDS Studio development concepts and techniques are not


difficult to learn
The MDS platform introduces a new programming paradigm,
however:

•MDS Studio leverages well known techniques from familiar programming models
and optimizes and simplifies them for Wireless (Does XML + Script sound
familiar?)
•Business logic and workflow can be extended using standard JavaScript
•Integration with backend data sources leverages web service (WSDL) and
database standards (SQL)
•MDS Studio makes it very easy to build simple, prototype style applications which
can be used as foundations for full-scale deployments
Welcome to
Where to start? The Next Level
BlackBerry Technical Seminar 2007

MDS Studio design approaches range from fully generated to


completely customized

Quick Start approach


•Great for rapid prototyping

Bottom Up approach
•Useful when working with a pre-existing data source
•Data Source Update wizard manages change

Top Down approach


•Most versatile approach
•Useful when building back-end in parallel with your MDS Studio application
Welcome to
The Next Level
What is an MDS Studio Application?
BlackBerry Technical Seminar 2007

Data: Store persistent and transient application data on device


Messages: Represent data sent or received from an external source
Screens: Define the user interface of the application
Data source bindings: Map inbound / outbound messages to data source operations
Cross-component mappings: Define application workflow without explicit coding

Messages
Screens Cross-component
mappings

JavaScripts Bindings
Data Source
Workflow
Data

kBerry MDS Studio Application components


Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Data Components
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

BlackBerry MDS Studio Application data components

• Data can be used in the following ways:


• Data updates the user interface
• User interface updates the data
• Application data is sent to the data source using outbound messages
• Data source changes are sent to the application using inbound
messages
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

BlackBerry MDS Studio Application data


components

•Use the following techniques to access a data component:


• Pass the data component as a parameter to a screen or script
• Create the data component in script
• Find a data component in a script
• Specify the data component as a nested field of another keyed or keyless
data component
• Declare a variable as a data component type and initialize the variable
through a cross-component mapping
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Keyed data components and data collections

• a keyed data component has a primary key


• when an instance of a keyed data component is created, the data component becomes part of a
data collection
• BlackBerry MDS Studio allows database operations on a collection of keyed data components
• retrieve a keyed data component by the primary key
• retrieve an array of keyed data components using a Where clause (one field condition
only)
• sort returned results from a data collection by any field
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Keyless data components

• define the structural definition of data


• do not have a primary key
• cannot be managed as data collections
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Data storage modes

• two data storage modes available:


• transient
• persistent
• right-click and select one of these options to change the storage mode for a global variable:
• Make transient
• Make persistent
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Creating and managing data components

• Create a data component before any instances can be created


Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Viewing a data component


• The Data Editor displays the properties, fields, and relationships of a data component
• Double-click a data component in the Navigator pane to open the Data Editor
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Viewing a data component

• Three basic actions available with the Data Editor:

Action Icon

Basic Properties

Show Relationship Canvas

Hide Relationship Canvas


Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Creating a data component


• Right-click Data > Definitions in the Navigator pane and select New Data Definition
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Creating a data component field

• select the Fields tab in the Data Editor, click +, and configure:
• Name
• Type
• Array
• Default Value
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Creating an instance of a data component

• Created in a script or as a result of cross-component mappings


• Instances created in the following circumstances:
• When an application script makes an explicit call
• When an inbound message mapped to a data component arrives, the application creates
a data component instance or updates the data component if the matching instance exists
• When a user enters input in a screen control mapped to a screen local variable, the
application instantiates the local variable based on the user input and creates a new data
component instance
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Remove an instance of a data component

• removed in script
• removed by setting all references to a keyless data component to null
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Creating and managing global variables

• available to any screen, data, or message component


• useful for maintaining the state of an application and for simplifying application workflow
• global variables can contain the following:
• primitive data types
• enumerated values
• keyed or keyless data components
• arrays of primitive types
• arrays of data components
Welcome to
Data Components The Next Level
BlackBerry Technical Seminar 2007

Using built-in data components from BlackBerry device


applications

• Use BlackBerry device application data by mapping screen controls and data components to
built-in data components
• Built-in data components available:
• Contact
• Address
• Event
• Attendee
• RepeatRule
• Message
• Task
• DeviceInfo
Welcome to
Screen Components The Next Level
BlackBerry Technical Seminar 2007

Screen Components
Welcome to
Screen Components The Next Level
BlackBerry Technical Seminar 2007

Menu Pane

Create menus by
dropping MenuItems
Control Palette onto the Menu Pane

Create screens by dropping


controls on screen from the
Control Palette

Screen Viewer
Welcome to
Screen Components: Screen Viewer The Next Level
BlackBerry Technical Seminar 2007

Menu Item
Image

Label

Edit Box Region with vertical layout


Choice

Separator

Region with grid layout


Button
Welcome to
Screen Components: Properties The Next Level
BlackBerry Technical Seminar 2007

Initial Value and Mapping allow you


to map data components to screen controls
Welcome to
Screen Components: Data Mapping The Next Level
BlackBerry Technical Seminar 2007

User-interface controls support bi-directional mapping to data


• Initial Value populates control with data
• Output mapping populates data

Use screen parameters, Globals,


or data collections to add dynamic
content to screen controls
Screen Components: Data Mapping Welcome to
The Next Level
Revisited
BlackBerry Technical Seminar 2007

Use output mapping of control to


automatically store value into
underlying data component or
global
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Message Components
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

About application data messages

• Two supported types of application messages:


• Inbound messages
• Outbound messages
• Depending upon the features of the data source, a message can be any of the following:
• notification
• request for information
• response to a request
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Inbound messages

• for inbound BlackBerry MDS Studio™ Application messages, the BlackBerry® device receives
information from the data source
• request-response inbound message
• notification inbound message
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Outbound messages

• for outbound BlackBerry MDS Studio Application messages, the application sends information
to the data source
• request-response outbound message
• event outbound messages
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

About mapping application messages to data

• Used to specify
• the BlackBerry MDS Studio Application message definition
• the interaction with the BlackBerry MDS Studio Application data model at runtime
• Application messages can be mapped to the following types of data components:
• global variables
• keyed data collections
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Limitations

• There are some rules that apply to inbound and outbound message mappings based on
message assignment type:
• Entire data structure
• map a message to an entire global variable
• map a message to a data collection
• Partial data structure
• map a message to one or more fields in a global variable
• map a message to one or more fields in a data collection
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Creating application messages

• messages can be mapped to data using two methods:


• using the New Message wizard
• using script
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Using the New Message wizard

• The wizard is used when:


• adding a message when using the top-down approach
• adding a new message to a bottom-up application
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Defining message properties

• Message properties that can be set from the Basic Properties tab of the Message Editor:
• rename the message
• assign a security level to
the message
• assign a script to the
message (inbound
messages only)
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Defining the message structure

• actions available to define the message structure:


• name the message field
• select a data type for the field
• set the data mapping for the
field
• set the message field to an
array of the selected data type
• set a default value for the
message field
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Creating an inbound message that updates application data

• Inbound messages may need to update data in one of the following ways:
• update a single data component, or update a field within a top-level data component
• update a data component that is part of another data component
• update the value of a global variable
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Creating an inbound message that triggers an alert

• An alert attached to an inbound message informs the user that an event has taken place
• Alert types can be combined with the default alert using the following options:
• Ribbon
• Dialog
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Receiving confirmation of sent messages

• Two strategies for delivering messages between BlackBerry MDS Studio applications and the
BlackBerry MDS Services:
• best-effort
• no delivery and ordering guarantee
• standard
• delivery and ordering guarantee
Welcome to
Message Components The Next Level
BlackBerry Technical Seminar 2007

Flow control
• Queues five packets for delivery until time-out is reached
• The default flow control time-out for BlackBerry MDS Services is 10 minutes

Time-out
• While these packets are queued for delivery, no further packets are pushed until the original five
packets are acknowledged by the BlackBerry device
• Subsequent push packets are also subject to a time-out period, and will be discarded after the
time-out is reached
Welcome to
Database Connector The Next Level
BlackBerry Technical Seminar 2007

Database Connector
Introducing the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Supported Database Servers

Microsoft® SQL Server 2005

Oracle® 9i
Introducing the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Database Connector Allows

•MDS Studio models a database as a set of operations, messages and


types
•Concentrate on the business logic, workflow and user experience
•Design the custom operations to access the database
•Use pre-existing stored procedures or functions
•Bind select operations to application messages
•Application development procedure is similar to when using web services
Introducing the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Top 10 Database Connector Features

• Add a database data source


• Access to stored procedures and functions
• Design new operations
• Support for database specific extensions
• Identity constraints
• Pagination support
• Built-in transaction control
• Automatic binding of operations
• Support for composite keys
• Table control
Introducing the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

3 Steps to create a Database Connector Application

Step 1: Decide what data will be exposed wirelessly.


Tables, Views

Step 2: Determine what operations will be available to users.


Stored procedures, Queries, Updates, Inserts, Deletes

Step 3: Design screens around data and operations.


Build workflows, add dynamic content, add images
Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Creating a New Application

•Use the same Wizard used when connecting to a web service


• Select a Database Server to connect to.
Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Creating a New Application

•Enter the database connection information


Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Creating a New Application

•Bind the application to your database


Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Creating a New Application

•Enter a Project Name to create your application


Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Database Operations
•Database Operations are used to interact with your database
•Similar to Message Components when using a web services
•There are 2 design modes you can use to accomplish this
• Visual Mode
• Advanced Mode
Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Visual Design Mode

•Provides a GUI designer to create your SQL query


•Step 1: Choose the type of query to create:
• SELECT
• INSERT
• UPDATE
• DELETE
Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Visual Design Mode


•Step 2: Choose the table you wish to query
Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Visual Design Mode


•Step 3: Select the columns you want to query
Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Visual Design Mode


Step 4: Define the criteria for your query
• Predicates (WHERE clause criteria)
• Order By criteria
• Group By criteria
Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Visual Design Mode


•Step 5: Test the query
•You will not be able to advance until MDS Studio verifies that the query will execute
• Changes can be rolled back
• Useful for testing INSERT, UPDATE and DELETE queries
•Result set is displayed
•Enable Paging to reduce wireless traffic
Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Advanced Design Mode

•Allows a developer to manually enter the SQL query


•Jumps straight to the query test screen (similar to Step 5 of the Visual design mode)
•You will not be able to save the operation until MDS Studio verifies that the query will
execute
• Changes can be rolled back
• Useful for testing INSERT, UPDATE and DELETE queries
•Result set is displayed
•Enable Paging to reduce wireless traffic
Working with the Database Welcome to
The Next Level
Connector BlackBerry Technical Seminar 2007

Displaying Database Data

•Data can be manipulated and shown to users in the


following ways
• Referenced by JavaScript
• Shown in a standard screen component (Label,
EditBox, etc...)
• Displayed in a table 
• Table is enabled for horizontal and vertical scrolling
Welcome to
MDS Studio The Next Level
BlackBerry Technical Seminar 2007

Thank you!

Вам также может понравиться