Sound this chapter is jointly translated by the author and netizen withwind. --------------------------------------------------
This chapter is jointly translated by the author and netizen withwind.
--------------------------------------------------
Communication client components to the server
When designing the communication of the client component to the server, you must apply the interface as small and fine-grained components to form an interface, and you need to have the ability to include other components, but also keep it * component function Central control * message reception Central Control * Service Communication Central Control * Separated code to control interface logic and event management
This design has established four classes on the basis of the user interface, as shown below:
Figure 6: Four classes needed by client components to server communications
These four respective responsibilities are as follows: * The user interface is where the control (calendar, data sheet, check box, color, etc.) is dependent. * View logic contains code, mapping data to fields, depicts data, and more. * Local data model refers to components that saved data for applications. * The controller and coordinator are often implemented as a component. - The controller is responsible for controlling all the processes for user interface. It determines how to handle events from remote servers or from user interfaces. - The coordinator is responsible for external communication from components to remote services. The coordinator is also responsible for carrying those methods from remote service callbacks.
According to this way, the user interface is designed, regardless of the form in which the components are placed in the interface, and the UI components maintain their individual independence. By providing an universal abstract interface for individual components, the coordinator allows the UI component to operate independently or as part of a larger interface component. The following figure depicts the client structure:
Figure 7: Client architecture
Taking banking as an example, it contains an interface component that can be submitted to the bank with a user service request. The service intermediary requests a processor for this remote service from the interface component such that it can run the appropriate method. This interface includes a large number of controls and a button to trigger a response event. The view logic of the interface controller can capture the event. When an event is called, it triggers the controller and notifies the view logic to establish a local data model for this transaction. After the application is ready to prepare the data model, the controller notifies the coordinator to let it submit a user service request and pass the collected data. The coordinator is associated with the service intermediary, requested the appropriate service and passed to it a handle for itself. When the coordinator is passed from the service intermediary, it issues a message to generate the appropriate request. When the service running on the server is over, it passes the reaction data message to the client. Bridge guides this reaction message to the coordinator to determine which method on the calling controller and then calls that information to the correct transition interface appearance.
Eternal theme
Shun a syndrome, any application architecture gradually becomes off its unique needs, and begins to follow a strict design method. This article proposes two huge client patterns, and you should apply the universal views of the universal views in all application development projects. Later articles will explain more special design patterns and problems they can solve.
Enrich migration
Software development, and the viewpoint of promoting software development gradually develop towards the "technical and problem collection" direction. The traditional model developed by the web program has organized information and program resources to deal with broad user needs, but often is very bad in availability and user experience. RIA reserves this web deployment mode in mind to respond to the user experience. In this way, this concept is to expand around how to construct new features and user mode applications. Minor variations are generated in viewpoints, using existing backend servers and program structures, can also provide a better user experience.
(Please pay attention! Quote, transfer this article to note: rosen Jiang and the source: http://blog.9cbs.net/ROSEN