Macro Components"

From Documentation
m (Created page with '{{ZKDevelopersGuidePageHeader}} There are two ways to implement a component. One is to implement a class deriving from the <javadoc>org.zkoss.zk.ui.AbstractComponent</javadoc> c…')
 
 
Line 3: Line 3:
 
There are two ways to implement a component. One is to implement a class deriving from the <javadoc>org.zkoss.zk.ui.AbstractComponent</javadoc> class. The other is to implement it by use of other components.
 
There are two ways to implement a component. One is to implement a class deriving from the <javadoc>org.zkoss.zk.ui.AbstractComponent</javadoc> class. The other is to implement it by use of other components.
  
The former one is more flexible. It requires deeper understanding of ZK, so it is usually done by component developers. It is discussed in the '''Component Development Guide'''.
+
The former one is more flexible. It requires deeper understanding of ZK, so it is usually done by component developers. It is discussed in the [http://books.zkoss.org/wiki/ZK_Component_Reference ZK Component Reference].
  
 
On the other hand, implementing a new component by use of other components is straightforward. It works like composition, macro expansion, or inline replacement. For sake of convenience, we call this kind of components as ''macro components''., while the others are called ''primitive components''.
 
On the other hand, implementing a new component by use of other components is straightforward. It works like composition, macro expansion, or inline replacement. For sake of convenience, we call this kind of components as ''macro components''., while the others are called ''primitive components''.

Latest revision as of 07:53, 20 July 2010

Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


There are two ways to implement a component. One is to implement a class deriving from the AbstractComponent class. The other is to implement it by use of other components.

The former one is more flexible. It requires deeper understanding of ZK, so it is usually done by component developers. It is discussed in the ZK Component Reference.

On the other hand, implementing a new component by use of other components is straightforward. It works like composition, macro expansion, or inline replacement. For sake of convenience, we call this kind of components as macro components., while the others are called primitive components.

Tip: a macro component is no different from a primitive component from application developer's viewpoint, except how it is implemented.



Last Update : 2010/07/20

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