[jboss-cvs] JBossAS SVN: r103223 - projects/microcontainer/mcdocs/trunk/userguide/src/main/docbook/en-US.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 30 00:39:59 EDT 2010


Author: misty at redhat.com
Date: 2010-03-30 00:39:58 -0400 (Tue, 30 Mar 2010)
New Revision: 103223

Modified:
   projects/microcontainer/mcdocs/trunk/userguide/src/main/docbook/en-US/Getting_Started.xml
Log:
More editing


Modified: projects/microcontainer/mcdocs/trunk/userguide/src/main/docbook/en-US/Getting_Started.xml
===================================================================
--- projects/microcontainer/mcdocs/trunk/userguide/src/main/docbook/en-US/Getting_Started.xml	2010-03-30 03:29:47 UTC (rev 103222)
+++ projects/microcontainer/mcdocs/trunk/userguide/src/main/docbook/en-US/Getting_Started.xml	2010-03-30 04:39:58 UTC (rev 103223)
@@ -243,19 +243,11 @@
 	<term>Does a class have to implement an interface in order to provide a well-defined interface?</term>
 	<listentry>
 	  <para>
-	    
-	  </para>
-	</listentry>
-      </varlistentry>
-      <varlistentry>
-	<term></term>
-	<listentry>
-	  <para>
 	    Not necessarily. Providing that you do not remove fields or methods from a class, or restrict access to them, you can always change its implementation without recompiling any clients. See the section entitled <ulink url="http://java.sun.com/docs/books/jls/second_edition/html/execution.doc.html#44524" >Resolution of Symbolic References</ulink> from the Java Language Specification for more details.
 	  </para>
-	  <para>
-	    The <emphasis>well-defined</emphasis> interface in this respect is composed from the original class's fields and methods together with their access modifiers.
-	  </para>
+	    <para>
+	      The <emphasis>well-defined</emphasis> interface in this respect is composed from the original class's fields and methods together with their access modifiers.
+	    </para>
 	</listentry>
       </varlistentry>
     </variablelist>
@@ -276,90 +268,112 @@
     </para>
     <section>
       <title>Creating POJOs</title>
-      <para>The example that relates to this section can be found in the
-      <filename>examples/User_Guide/gettingStarted/humanResourcesService</filename> directory. The
-      directory layout, as with all of the examples for the User Guide, follows the <ulink
-      url="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html"
-      >Maven Standard Directory Layout</ulink>.</para>
       <para>
-	<programlisting>humanResourcesService/pom.xml
-	/src/main/java
-	/test/java
-	/test/resources</programlisting>
+	The example that relates to this section can be found in the <filename>examples/User_Guide/gettingStarted/humanResourcesService</filename> directory. The directory layout, as with all of the examples for the User Guide, follows the <ulink url="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html" >Maven Standard Directory Layout</ulink>.
       </para>
-      <para>Java source files are located in packages beneath the src/main/java directory:</para>
+      <variablelist>
+	<title>Directory Structure of humanResourceService Project</title>
+	<varlistentry>
+	  <term><filename>humanResourcesService/</filename></term>
+	  <listitem>
+	    <itemizedlist>
+	      <listitem><filename>pom.xml</filename></listitem>
+	      <listitem><filename>/src/main/java/</filename></listitem>
+	      <listitem><filename>/test/java/</filename></listitem>
+	      <listitem><filename>/test/resources</filename></listitem>
+	    </itemizedlist>
+	  </listitem>
+	</varlistentry>
+      </variablelist>
       <para>
-	<programlisting>org/jboss/example/service/Address.java
-	/Employee.java
-	/HRManager.java
-
-	org/jboss/example/service/util/SalaryStrategy.java
-	/AgeBasedSalaryStrategy.java
-	/LocationBasedSalaryStrategy.java</programlisting>
+	Java source files are located in packages beneath the <filename>src/main/java directory</filename>:
       </para>
-      <para>Each of these classes represents a simple POJO that doesn&apos;t implement any special
-      interfaces. The most important class is HRManager as this represents the service entry
-      point providing all of the public methods that clients will call.</para>
+      <variablelist>
+	<title>Contents of <filename>src/main/java/</filename> directory</title>
+	<varlistentry>
+	  <term><filename>org/jboss/example/service/</filename></term>
+	  <listitem>
+	    <itemizedlist>
+	      <listitem><filename>Address.java</filename></listitem>
+	      <listitem><filename>Employee.java</filename></listitem>
+	      <listitem><filename>HRManager.java</filename></listitem>
+	    </itemizedlist>
+	  </listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><filename>org/jboss/example/service/util/</filename></term>
+	  <listitem>
+	    <itemizedlist>
+	      <listitem><filename>SalaryStratagy.java</filename></listitem>
+	      <listitem><filename>AgeBasedSalaryStrategy.java</filename></listitem>
+	      <listitem><filename>LocationBasedSalaryStrategy.java</filename></listitem>
+	    </itemizedlist>
+	  </listitem>
+	</varlistentry>
+      </variablelist>
+      <para>
+	Each of these classes represents a simple POJO that does not implement any special interfaces. The most important class is <classname>HRManager</classname>, because it represents the service entry point providing all of the public methods that are called by clients.
+      </para>
       <itemizedlist>
 	<listitem>
-	  <para>addEmployee(Employee employee)</para>
+	  <para><methodname>addEmployee(Employee employee)</methodname></para>
 	</listitem>
 	<listitem>
-	  <para>removeEmployee(Employee employee)</para>
+	  <para><methodname>removeEmployee(Employee employee)</methodname></para>
 	</listitem>
 	<listitem>
-	  <para>getEmployee(String firstName, String lastName)</para>
+	  <para><methodname>getEmployee(String firstName, String lastName)</methodname></para>
 	</listitem>
 	<listitem>
-	  <para>getEmployees()</para>
+	  <para><methodname>getEmployees()</methodname></para>
 	</listitem>
 	<listitem>
-	  <para>getSalary(Employee employee)</para>
+	  <para><methodname>getSalary(Employee employee)</methodname></para>
 	</listitem>
 	<listitem>
-	  <para>setSalary(Employee employee, Integer newSalary)</para>
+	  <para><methodname>setSalary(Employee employee, Integer newSalary)</methodname></para>
 	</listitem>
 	<listitem>
-	  <para>isHiringFreeze()</para>
+	  <para><methodname>isHiringFreeze()</methodname></para>
 	</listitem>
 	<listitem>
-	  <para>setHiringFreeze(boolean hiringFreeze)</para>
+	  <para><methodname>setHiringFreeze(boolean hiringFreeze)</methodname></para>
 	</listitem>
 	<listitem>
-	  <para>getSalaryStrategy()</para>
+	  <para><methodname>getSalaryStrategy()</methodname></para>
 	</listitem>
 	<listitem>
-	  <para>setSalaryStrategy(SalaryStrategy strategy)</para>
+	  <para><methodname>setSalaryStrategy(SalaryStrategy strategy)</methodname></para>
 	</listitem>
       </itemizedlist>
-      <para>The Human Resources Service is therefore composed of a handful of classes which work
-      together to allow a list of employees, together with details of their addresses and
-      salaries, to be maintained by an HRManger. Thanks to the SalaryStrategy interface it is
-      possible to configure the HRManager so that different salary strategy implementations are
-      used. These place minimum and maximum limits on the salaries that can be awarded to
-      employees depending on various rules.</para>
-      <para>To compile the source code you simply need to enter <command>mvn compile</command> from the
-      <filename>humanResourcesService/</filename> directory. This will create a new directory called
-      <filename>target/classes</filename> containing the compiled code. To clean up the project and
-      remove the <filename>target</filename> directory simply enter <command>mvn clean</command>. </para>
-      <para>Now that we have compiled our classes we need to create instances of them. This is
-      done by creating an XML deployment descriptor that contains a list of beans representing
-      individual instances. Each bean is given a name so that the instance can be looked up at
-      runtime by clients.</para>
-      <programlisting role="XML">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-
-      &lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
-      xsi:schemaLocation=&quot;urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd&quot;
-      xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
-
-      &lt;bean name=&quot;HRService&quot; class=&quot;org.jboss.example.service.HRManager&quot;/&gt;
-      
-      &lt;/deployment&gt;</programlisting>
-      <para>Here we have declared that we want to create an instance of the HRManager class and
-      register it with the name HRService. This file is passed to an XML deployer associated
-      with the microcontainer at runtime to perform the actual deployment and instantiate the
-      beans.</para>
+      <para>
+	The Human Resources Service is composed of a handful of classes which work together to maintain a list of employees, together with salary and address information, to be maintained by an HRManger. The SalaryStrategy interface makes it possible to configure the HRManager to support multiple salary strategy implementations. Business logic such as minimum and maximum salary per job description can be set and enforced.
+      </para>
+      <para>
+	To compile the source code, enter <command>mvn compile</command> from the <filename>humanResourcesService/</filename> directory. This creates a new directory called <filename>target/classes</filename> containing the compiled code. To clean up the project and remove the <filename>target</filename> directory, enter <command>mvn clean</command>.
+      </para>
+      <para>
+	After you have compiled the classes, create instances of them. To do this, creating an XML deployment descriptor that contains a list of beans representing individual instances. Each bean is given a unique name to enable the clients to look it up at runtime.
+      </para>
+      <example>
+	<title>XML Deployment Descriptor for Human Resources Project</title>
+	<programlisting role="XML">
+	  &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+	  
+	  &lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+	  xsi:schemaLocation=&quot;urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd&quot;
+	  xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+	  
+	  &lt;bean name=&quot;HRService&quot; class=&quot;org.jboss.example.service.HRManager&quot;/&gt;
+	  
+	  &lt;/deployment&gt;
+	</programlisting>
+      </example>
+      <para>
+	This file creates an instance of the HRManager class and registers it with the name HRService. It is passed to an XML deployer associated with the microcontainer at runtime to perform the actual deployment and instantiate the beans.
+      </para>
     </section>
+    
     <section>
       <title>Wiring POJOs together </title>
       <para>So far we have seen how to create POJOs and declare instances of them together with




More information about the jboss-cvs-commits mailing list