[Flex] Introduction to mate flex Framework process using view Injection

Source: Internet
Author: User
Mate flex Framework process introduction:
Introduction to the process of mate flex framework from views to business logic
Introduction to the process of the mate flex framework: Dispatcher and responsehandler tags
Introduction to mate flex Framework process-listener tag
Introduction to the process of mate flex framework using an adapter
Introduction to mate flex Framework process using view Injection

This article introduces the last official process: bidirectional communication: Using view injection (two-way communication via model: Using view injection)

The following figure shows its flowchart:



In fact, this process is very similar to the previous process, that is: using an adapter introduced in the Process of mate flex framework


Using an adapter
The only difference between them is: No adapter is used in this process.But directly uses the injection method.

 

Okay, let's take a look at what the process looks like?
(Because Introduction to the process of mate flex framework using an adapter The code is not described in detail in this process, but the process is described)


1. In the view, we use the <dispatcher> mate tag to trigger an event.

2. Event bus will notify the event map of the triggered event ).

In event map, some event processing logic will be prepared in advance (that is, some eventhandler will be defined)

3. In these defined eventhandler, there will be a group of actions to respond to this event.

As shown in, a <serviceinvoker>

4. Use model manager to set some values.

5. When the attributes of the model manager change, the changes of the model manager are directly displayed in the view using the injection method.


In fact, these two flowcharts: Introduction to the mate flex framework process and using an adapter and mate flex framework process and using view Injection
There is no essential difference, but the method used in the last phase is different. The former uses the adapter method, while the latter uses the injection method.


Kenshin personally thinks the latter method is more direct and intuitive. If you want to see the example in this flowchart, please refer to the using an adapter introduced in the Process of mate flex framework.

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.