You can define attributes and operations of a mobile business object
(MBO) without immediately binding them to a data source, define them from and bind them to a
data source, or create an MBO that does not bind to a data source (local business object, or
uses only DCN as the refresh mechanism).
Prerequisites
Before developing MBOs, understand the key concepts and principals
described in
Fundamentals.
Also, see the companion guide,
Mobile Data Models: Using Mobile Business
Objects, for a deeper
understanding of how to build an efficient MBO model.
Task
The attributes and operations that define an MBO must be bound to a
data source at some point in the development process, unless it is a local business
object, or the MBOs data is to be loaded only through Data Change Notification
(DCN). If you already have a connection to the data source through a connection
profile, you can quickly generate attribute and operation bindings based on the data
source. However, if you do not have access to the required data source, you define
the MBO, but bind your operations and attributes to the data source at a later
point. The difference between the two development approaches is when you create and
bind the attributes and operations:
- Create an MBO and
bind to a data source immediately – includes two methods:
- Drag and
drop the data source onto the Mobile Application Diagram, which
launches the appropriate wizards and automatically creates bindings
based on the selected data source.
- Create an
MBO and its operations and attributes using the Mobile Application
Diagram and palette that launches a set of wizards and allows you to
bind them directly to a data source.
- Create an MBO and
defer data source binding – create an MBO and it's operations and attributes
using the Mobile Application Diagram and palette that launches a set of
wizards and allows you to bind the MBO to a data source at a later time.
After you define the data source, you bind the MBO to it from the Properties
view.
- Create an MBO using a DCN cache group policy without data source binding –
when an MBO's CDB data is to be filled only through DCN, a data source
binding is not necessary. In these cases, the MBO must reside in a cache
group that uses the DCN policy.
- Create a local business object – create a local business
object by clicking the local business object icon in the palette then click
the object diagram. Local business objects can only run on the client and
cannot be synchronized. It can contain attributes and operations that run on
the device. For example, the local business object could be combined with
other MBOs, where the local business object runs an object query against
results returned by other MBOs.