6. Introduction to composite UI Application Block (CAB) workitem

Source: Internet
Author: User
As mentioned above, Cab In addition to providing powerful support functions, such as dependency injection, event mechanism, and interface combination display ... , There is also a dedicated encapsulation of business logic Workitem . Enterprise application systems are mainly automated Implementation of Enterprise businesses. The support functions provided by an application framework are only for better service to businesses. Next let's take a look Cab In Workitem How to encapsulate Business Use Cases.

First, let's take a lookWorkitemWhat elements are contained?

from workitem that workitem supports commands and events, at the same time, workitem can be nested, with parent you can obtain the top-level workitem . developers can use this feature to organize their own business use cases and division. The granularity of Business Use Cases. use state In workitem to share information, objects in the same workitem container can share this information. workitem service

WorkitemBy callingRunMethod.OnrunstartedMethod.Workitem, You can reloadOnrunstartedMethod to customize its startup logic.RunMethod call will triggerRunstartedEvent.

We usually useWorkitemFeatures provided, usingMVC. UseSmartpartAs a user interactionUIShow part (ViewCreate a control class to encapsulate the business logic (Controller), And then store the business data in the memory entity (Model). The user interface is associated with the memory entity by binding.

This is a typical MVCTo see how operations are performed during initialization and user interaction?

 

Initialization:

 

1. Application System LoadingWorkitem, workitemSet the user interface inWorkspaceTo display
2. Load the user interface and call the control logic to process and obtain the initial data.
3. The control logic obtains the initial data.
4. The control logic stores data in the memory entity.
5. The control logic binds the data to the user interface, which is automatically initialized and displayed based on the bound data source.

User interaction:

 

1 on the user interface, call the corresponding control logic
2 . The control logic is used for business processing, access related services or databases
3 , control Logic modify data in memory entities
4 because data is bound to the interface, data changes are directly reflected on the interface.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.