3. View Fundamentals


  • 3.1 Design Objective

    The server focuses on the functional data and the client concentrates on the data presentation. It is no necessary to implement the extra structural logic source codes which are not related to the final requirements and difficult to be maintained any more.



  • 3.2 Basic Concept

    • VIEW: A View is a named structure description, and the definition of the name should reflect the specific feature. A serial Fields are included in this data structure, where the client View is consistent with the server View. The modification in the field of the server View will be synchronized to the same field of the client View.

      There are four types of modification for the field: NEW, REPLACE, TOUCH and DELETE. NEW: the server has set the field, and this field's value is changed from none to existed. REPLACE: the server has set the field, but this field's value is different from the previous one. TOUCH: the server has set the field, and this field's value is the same as the previous one. DELETE: the server removes the field, and this field's value is changed from existed to none. Further, the change order of the View's fields is strictly guaranteed so that the client could reproduce the fields' order in the same View which is modified by the server. The sequence between the different Views could not be ensured.

    • CONTROL: A Control is the control commands sent from the client to the server, which is in the View's namespace.

      Combining the two concepts of the View and the Control together could be explained like that the client sends the control commands to the server, the server modifies the View's status and this status is reflected to the client. The causality between the Control and the View's status changing is not compulsive. Even without Control, the server still could change the View in order to achieve the push operation. It does not mean the implementation of this Control only could modify the current View although its definition is in the View's namespace.



  • 3.3 The relative Concepts

    • SessionId: A SessionId is the client's unique identification which is the ID assigned to the client by the system when the client login the server and the corresponding session is established.

    • There are three types of View: GlobalView, SessionView, and TemporaryView

    • GlobalView: A GlobalView is a View with the server's lifecycle. The change of the View could not be automatically synchronized to the client. Manually invoking the synchronization method to synchronize the latest data of the entire View or some field of the View to one or multiple clients is essential.

    • SessionView: A SessionView is a View with the session's lifecycle. The SessionView will be automatically created according to the SessionId's classification when the client login the server and a session is established. When the View' field is changed, the value of this filed will be automatically synchronized to the corresponding client.

    • TemporaryView: A TemporaryView is a view with the temporary lifecycle, which is manually created and deleted during the execution of the server application. The TemporaryView is the most flexible and most complicated in the usage View. By using Membership, the TemporaryView maintains the set of the SessionId to manage the members, and provides the broadcast feature, through which the field's value will be automatically broadcasted to all the members of the Membership when View's field changes. The TemporaryView has a more powerful capability: subscribing the SessionView field of the members. When one member's subscribed SessionView field changes, this change will be automatically broadcast to all the members of the Membership.

    • ViewContext: A ViewContext is the context of the View. The server and the client have their own ViewContext. The ViewContext has the server's lifecycle or the client's lifecycle, through which the View could be accessed. The ViewContext is usually used by the codes generated by the Limax.

    • ViewChangedListener: A ViewChangedListener is a key application interface of the client, which is used to receive the change event of the View's fields synchronized from the server. The ViewChangedListener mainly provides the five piece of information related to the change of the View: which View, which field, which SessionId, the current value of this field, the modification type --NEW, REPLACE, TOUCH and DELETE.

    • A Control is the control commands that the client sends to the server. There are two types of the Control: the Control, and the Message.

    • Control: The Control is defined in the namespace of the View. Several Controls could be defined in the same one namespace. The typed client framework supports this type of Control.

    • Message: The Message is the description used in the system implementation. The Message is the Control of the string parameter predefined by system to each View. The Message is supported by both the typed client and script client.

      If an application implemented need to support the categorized client and script client at the same time, the Message control is the only choice.


Prev Next