Designer 10.5 | webMethods Mobile Development | Creating Business Logic for a Mobile Application | About Adding Application Logic
 
About Adding Application Logic
When you generate sources for a mobile project, Mobile Development generates logic to handle the display of the views and dialogs in the mobile application. The generated code is based on the model you define in the Outline Editor. For example, for a view you design in the Outline Editor, Mobile Development generates logic to operate the user interface based on the user interface objects you add to a view and the property settings for each object. As a result, you do not need to add code for this type of logic for a mobile project. Instead, you can concentrate on the business logic for your application.
When coding the business logic for your application, add your custom code to the user space, that is, the Java classes that Mobile Development generates in the mobile project’s src folder.
CAUTION:
Do not add logic to the Java classes in the gen/src or gen/api-src folders. When you generate sources or when you generate sources and API for a mobile project, Mobile Development regenerates all the Java classes in those folders. Changes you make will be lost.
The following tables lists the types of business logic you might want to add to a mobile application.
Type of Logic
Description
General
Logic that applies to the entire application.
For example, you might want to add logic to respond when a user rotates a device from portrait mode to landscape or vice versa.
View
Business logic for a view.
For more information, see Logic for a View.
Dialog
Business logic for a dialog.
For more information, see Logic for a Dialog.
Method Name property
Logic for a Method Name property.
Several user interface objects have a Method Name property where you can specify a method to invoke at run time. For example, you specify a method name for the DynamicDropDownListEntryItem object to identify the method the application executes at run time to populate the parent DropDownListEntry object. For information, see Logic for a Method Name Property.
Property value
Logic to programmatically set a property.
Many properties allow you to specify a method name as the property value. At run time, the application executes the method to determine the property value. For example, you might want to programmatically determine the color to use for the Background Color property for a Tablerow object. To do so, specify the name of the method that sets the color as the value of the Background Color property. For information, see Logic to Programmatically Set a Property Value at Run Time.
Event handling
Logic to respond to a user-initiated event.
For more information, see Responding to User-Initiated Events.
View transitions
Logic to transition to another view.
For more information, see Logic to Transition to Another View
Templates
Logic for templates to define custom user interface objects.
For more information, see Creating a Template for a Custom Object.
Related Topics