Controller"

From Documentation
Line 4: Line 4:
 
The ''controller'' is a Java program that is used to glue UI (view) and Data (model) together.
 
The ''controller'' is a Java program that is used to glue UI (view) and Data (model) together.
  
For a simple UI, there is no need of controller. For example, the data of a <javadoc>org.zkoss.zul.Listbox</javadoc> could be abstracted by implementing <javadoc type="interface">org.zkoss.zul.ListModel</javadoc>.
+
A simple UI does not require any controllers. For example, the data of a <javadoc>org.zkoss.zul.Listbox</javadoc> could be abstracted by implementing <javadoc type="interface">org.zkoss.zul.ListModel</javadoc>.
  
 
For typical database access, the glue logic (i.e., control) can be handled by a generic feature called [[ZK Developer's Reference/Data Binding|Data Binding]]. In other words, the create, read, update and delete operations (CRUD) can be handled automatically by a generic Data Binding, and you don't need to write the glue logic at all.
 
For typical database access, the glue logic (i.e., control) can be handled by a generic feature called [[ZK Developer's Reference/Data Binding|Data Binding]]. In other words, the create, read, update and delete operations (CRUD) can be handled automatically by a generic Data Binding, and you don't need to write the glue logic at all.

Revision as of 07:17, 22 July 2011

Overview

The controller is a Java program that is used to glue UI (view) and Data (model) together.

A simple UI does not require any controllers. For example, the data of a Listbox could be abstracted by implementing ListModel.

For typical database access, the glue logic (i.e., control) can be handled by a generic feature called Data Binding. In other words, the create, read, update and delete operations (CRUD) can be handled automatically by a generic Data Binding, and you don't need to write the glue logic at all.

In this section we will discuss how to implement a custom controller (which is called a composer in ZK terminology).



Version History

Last Update : 2011/07/22


Version Date Content
     



Last Update : 2011/07/22

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.