<?xml version="1.0" encoding="UTF-8"?>
<chapter id="namingconv" xreflabel="namingconv" role="new">
    <?dbhtml filename="namingconv.html"?>
    <chapterinfo>
        <keywordset>
            <keyword>namingconv</keyword>
            <keyword>CDK</keyword>
	    <keyword>Guide</keyword>
        </keywordset>
    </chapterinfo>

    <title>Naming conventions</title>
    <para>
      During the development process, 
      the next naming convention for all project stuff should be mentioned.
	</para>
	<para>
		At first take a look at the definitions that are used in this structure. 
		Uppercase symbols means Java names notation. For name &quot;foo&quot;  &lt;name&gt; means &quot;foo&quot;, 
		and  &lt;Name&gt; - &quot;Foo&quot;: 
	</para>
	<table>
        <title>The structure definitions</title>
        <tgroup cols="2">
            <thead>
                <row>
                    <entry>Definition</entry>
                    <entry>Description</entry>
                </row>
            </thead>
            <tbody>
                <row>
                    <entry>
                        &lt;prefix&gt; 
                    </entry>
                    <entry>
                      A common library name for example, base JSF components use  &lt;javax.faces&gt; prefix. 
                      The value for prefix get from an abstract component package or a renderer template path.
                    </entry>
                </row>
                <row>
                    <entry>
                        &lt;name&gt;  
                    </entry>
                    <entry>
                     A name for a base component.
                     For UIInput component &lt;name&gt; is &quot;input&quot;. 
                     The value for a component name generator could be obtained from UI or Abstract class name.
                    </entry>
                </row>
                <row>
                    <entry>
                 		&lt;markup&gt;  
                    </entry>
                    <entry>
                		A render-kit generated content name:
                		&quot;html&quot; for <emphasis role="italic"><property>HTML/XHTML</property></emphasis> pages, 
                		&quot;wml&quot; for mobile content, etc. 
                		It should be provided in the render-kit description by Ant task 
                		or in <emphasis role="italic"><property>Maven&apos;s POM</property></emphasis>. 
                		By default, &quot;html&quot; is used.
                    </entry>
                </row>
                <row>
                    <entry>
                 		&lt;rendererName&gt;  
                    </entry>
                    <entry>
                		A name of the renderer for concreting a visual component implementation, e.g. &quot;commandButton&quot; , &quot;panelGroup&quot;, etc. 
                		A generator can take &lt;rendererName&gt; from a template file name.
                    </entry>
                </row>
                <row>
                    <entry>
                 		&lt;event&gt; 
                    </entry>
                    <entry>
                		A name for a Faces Event: &quot;action&quot; for all 
                		<emphasis role="italic"><property>ActionSource</property></emphasis> components like UICommand. 
                		It could be provided in the component configuration, or obtain from the implemented source interface.
                    </entry>
                </row>
            </tbody>
       </tgroup>
    </table>
	<para>
		Now let&apos;s take a look to the naming convention. 
		By default, a generator expects the written Java classes structure above: 
    </para>
	<table>
        <title>The Java classes structure</title>
        <tgroup cols="2">
            <thead>
                <row>
                    <entry>Naming convention</entry>
                    <entry>Description</entry>
                </row>
            </thead>
            <tbody>
                <row>
                    <entry>
                        &lt;prefix&gt;.component.Abstract&lt;Name&gt;
                    </entry>
                    <entry>
                        An optional abstract super-class for a JSF component. 
                        In order to avoid manual writing for EL-enabled getters/setters, saveState/restoreState methods, 
                        listener-related methods etc., you can create an abstract class, and a generator creates the implementation.
                    </entry>
                </row>
                <row>
                    <entry>
                        &lt;prefix&gt;.component.UIt&lt;Name&gt;
                    </entry>
                    <entry>
                        A Base component class. It can be generated from the abstract superclass or created by a developer.
                    </entry>
                </row>
                <row>
                    <entry>
                        &lt;prefix&gt;.component.&lt;markup&gt;.&lt;Markup&gt;&lt;RendererName&gt;
                    </entry>
                    <entry>
                        A renderer-specific generated component.
                        The &lt;Markup&gt; is a render-kit specific generation name such as <property>html</property>, 
                        <property>xml</property>, <property>wml</property>. 
                        In addition to the UI Component class, this class contains Java Bean getter/setter methods 
                        for renderer-specific attributes. 
                        This class is generated by CDK.
                    </entry>
                </row>
                <row>
                    <entry>
                        &lt;prefix&gt;.t&lt;Name&gt;
                    </entry>
                    <entry>
                        A JSF UI component type. Can be provided in the configuration or calculated from a component class name. 
                    </entry>
                </row>
                <row>
                    <entry>
                      &lt;prefix&gt;.&lt;Markup&gt;&lt;RendererName&gt;        
                    </entry>
                    <entry>
                        A renderer-specific JSF component type. Can be provided in the configuration or calculated from the renderer name. 
                    </entry>
                </row>
                <row>
                    <entry>
                    	&lt;prefix&gt;.renderkit.&lt;RendererName&gt;RendererBase
                    </entry>
                    <entry>
                       A Renderer Base class is an optional Renderer superclass, 
                       implements methods from the template renderer. 
                       Should be created by you.
                    </entry>
                </row>
                <row>
                    <entry>
                    	&lt;prefix&gt;.renderkit.&lt;markup&gt;&lt;RendererName&gt;
                    </entry>
                    <entry>
                        A generated Renderer
                    </entry>
                </row>
				<row>
                    <entry>
                        &lt;prefix&gt;.&lt;RendererName&gt;
                    </entry>
                    <entry>
                       A JSF renderer type. Can be provided in the configuration or calculated from a renderer name. 
                    </entry>
                </row>
                <row>
                    <entry>
                    	&lt;prefix&gt;.&lt;Markup&gt;&lt;RendererName&gt;.xml
                    </entry>
                    <entry>
                        A template for generating the renderer class. 
                        JSPX syntax is used. Should be provided by you. 
                    </entry>
                </row>
               	<row>
                    <entry>
                    	&lt;prefix&gt;.taglib.&lt;RendererName&gt;Tag
                    </entry>
                    <entry>
                        A JSP tag class
                    </entry>
                </row>
               	<row>
                    <entry>
                		&lt;prefix&gt;.taglib.&lt;RendererName&gt;TagHandler      
                    </entry>
                    <entry>
                        A Facelets Tag Handler class. 
                    </entry>
                </row>
                <row>
                    <entry>
                        &lt;RendererName&gt;
                    </entry>
                    <entry>
                        A JSP/Facelets Tag name
                    </entry>
                </row>
            </tbody>
        </tgroup>
    </table>
    <para>
    	Here is the Java classes structure for the components, that uses JSF events:
    </para>      
    <table>
        <title>The Java classes structure for components, that uses JSF events</title>
        <tgroup cols="2">
            <thead>
                <row>
                    <entry>Naming convention</entry>
                    <entry>Description</entry>
                </row>
            </thead>
            <tbody>
                <row>
                    <entry>
                    	&lt;prefix&gt;.event.&lt;Event&gt;Event     
                    </entry>
                    <entry>
                        An event class, that you should provide.
                    </entry>
                </row>
                <row>
                    <entry>
                        &lt;prefix&gt;.event.&lt;Event&gt;Listener 
                    </entry>
                    <entry>
                        An event listener interface,that could be generated by <property>CDK</property> 
                    </entry>
                </row>
                <row>
                    <entry>
                        &lt;prefix&gt;.event.&lt;Event&gt;Source
                    </entry>
                    <entry>
                        An interface for an event processing component, that includes the following methods:
                        add&lt;Event&gt;Listener(&lt;Event&gt;Listener listener ), 
                        remove&lt;Event&gt;Listener(&lt;Event&gt;Listener listener )
                    </entry>
                </row>
                <row>
                    <entry>
                        &lt;prefix&gt;.event.&lt;Event&gt;EventWrapper 
                    </entry>
                    <entry>
                       A wrapper class, that is used for binding listener&apos;s EL-expression in user&apos;s beans.
                    </entry>
                </row>
                <row>
                    <entry>
                        &lt;prefix&gt;.taglib.&lt;Event&gt;ListenerTag 
                    </entry>
                    <entry>
                        A JSP tag class for a creating listener instance. 
                        A parent tag must creates component implementing Source interface.
                    </entry>
                </row>
                <row>
                    <entry>
                		&lt;prefix&gt;.taglib.&lt;Event&gt;ListenerTagHandler         
                    </entry>
                    <entry>
                        A Facelets tag class for creation of listener instance.
                    </entry>
                </row>
                <!-- row>
                    <entry>
                        process&lt;Event&gt; 
                    </entry>
                    <entry>
                        An event processing method name in a listener interface.
                    </entry>
                </row-->
            </tbody>
        </tgroup>
    </table>
</chapter>