<HTML>
<BODY>
<P ALIGN="CENTER"></P>
<FONT SIZE=4><P ALIGN="CENTER">Table of Contents</P>
</FONT><B><FONT SIZE=2><P><A NAME="_Toc441640278"><A NAME="_Toc441640301"><A NAME="_Toc441640327"><A NAME="_Toc441640279"><A NAME="_Toc441640302"><A NAME="_Toc441640328"><A NAME="_Toc441640463"><A NAME="_Toc441645002"><A NAME="_Toc441647749"><A NAME="_Toc441915884"><A NAME="_Toc441919113"><A NAME="_Toc442155447"><A NAME="_Toc442155981"><A NAME="_Toc442165078"><A NAME="_Toc442261714"><A NAME="_Toc442263314"><A NAME="_Toc400788842"><A NAME="_Toc400789512"><A NAME="_Toc402061269"><A NAME="_Toc402061846"><A NAME="_Toc402061885"><A NAME="_Toc410016922"><A NAME="_Toc410120284"><A NAME="_Toc410197300"><A NAME="_Toc410465518"><A NAME="_Toc410465655"><A NAME="_Toc410465693"><A NAME="_Toc410466713"><A NAME="_Toc410539829"><A NAME="_Toc410618169"><A NAME="_Toc410618228"><A NAME="_Toc410618321"><A NAME="_Toc410618535"><A NAME="_Toc410731166"><A NAME="_Toc411135151"><A NAME="_Toc412375366"><A NAME="_Toc412459805"><A NAME="_Toc412460578"><A NAME="_Toc412512042"><A NAME="_Toc412512108"><A NAME="_Toc412520988"><A NAME="_Toc412521580"><A NAME="_Toc412550867"><A NAME="_Toc412596969"><A NAME="_Toc412598936"><A NAME="_Toc412599844"><A NAME="_Toc412600325"><A NAME="_Toc412616034"><A NAME="_Toc412616166"><A NAME="_Toc412616512"><A NAME="_Toc412971478"><A NAME="_Toc412975272"><A NAME="_Toc413051428"><A NAME="_Toc413056982"><A NAME="_Toc413210070"><A NAME="_Toc414355291"><A NAME="_Toc415469650"><A NAME="_Toc415644146"></A></A></A>REVISION LOG&#9;</B></FONT><A HREF="#_Toc446894773">*</A>
<B><FONT SIZE=2><P>2.&#9;introduction&#9;</B></FONT><A HREF="#_Toc446894774">*</A></P>
<B><FONT SIZE=2><P>3.&#9;pre-pop processing (&quot;Before you Pop&quot;)&#9;</B></FONT><A HREF="#_Toc446894775">*</A></P>
<FONT SIZE=2><P>3.1&#9;Familiarizing yourself with pox and poxen&#9;</FONT><A HREF="#_Toc446894776">*</A></P>
<FONT SIZE=2><P>3.2&#9;Using POX to describe a class.&#9;</FONT><A HREF="#_Toc446894777">*</A></P><DIR>
<I><FONT SIZE=2><P>3.2.1&#9;</I></FONT><A HREF="#_Toc446894778">*</A></P>
<I><FONT SIZE=2><P>A sample written description of a hypothetical class:&#9;</I></FONT><A HREF="#_Toc446894779">*</A></P>
<I><FONT SIZE=2><P>3.2.2&#9;A sample pox description of a hypothetical class (&quot;Us_company.pox&quot;):&#9;</I></FONT><A HREF="#_Toc446894780">*</A></P></DIR>
<FONT SIZE=2><P>3.3&#9;Setting Environment Variables prior to processing poxen.&#9;</FONT><A HREF="#_Toc446894781">*</A></P>
<FONT SIZE=2><P>3.4&#9;</FONT><A HREF="#_Toc446894782">*</A></P>
<FONT SIZE=2><P>Understanding how the pox utilities parse their parameters&#9;</FONT><A HREF="#_Toc446894783">*</A></P>
<FONT SIZE=2><P>3.5&#9;Creating documentation using &quot;poxhtml&quot;&#9;</FONT><A HREF="#_Toc446894784">*</A></P>
<FONT SIZE=2><P>3.6&#9;Creating Perl modules using &quot;poxperl&quot;&#9;</FONT><A HREF="#_Toc446894785">*</A></P>
<FONT SIZE=2><P>3.7&#9;Creating database schema using &quot;poxdb&quot;&#9;</FONT><A HREF="#_Toc446894786">*</A></P>
<FONT SIZE=2><P>3.8&#9;Using &quot;schemadrop&quot;&#9;</FONT><A HREF="#_Toc446894787">*</A></P>
<FONT SIZE=2><P>3.9&#9;</FONT><A HREF="#_Toc446894788">*</A></P>
<FONT SIZE=2><P>Using &quot;schemaload&quot;&#9;</FONT><A HREF="#_Toc446894789">*</A></P>
<STRIKE><FONT SIZE=2><P>3.10</STRIKE>&#9;<STRIKE>Merging pox changes with an updated perl module</STRIKE>&#9;</FONT><A HREF="#_Toc446894790">*</A></P>
<FONT SIZE=2><P>3.11&#9;Perl class code required when you add an attribute to your class&#9;</FONT><A HREF="#_Toc446894791">*</A></P><DIR>
<I><FONT SIZE=2><P>3.11.1&#9; Scalar non-object&#9;</I></FONT><A HREF="#_Toc446894792">*</A></P>
<I><FONT SIZE=2><P>3.11.2&#9; Scalar object&#9;</I></FONT><A HREF="#_Toc446894793">*</A></P>
<I><FONT SIZE=2><P>3.11.3&#9; List of non-objects&#9;</I></FONT><A HREF="#_Toc446894794">*</A></P>
<I><FONT SIZE=2><P>3.11.4&#9; List of objects&#9;</I></FONT><A HREF="#_Toc446894795">*</A></P>
<I><FONT SIZE=2><P>3.11.5&#9; Hash of non-objects&#9;</I></FONT><A HREF="#_Toc446894796">*</A></P>
<I><FONT SIZE=2><P>3.11.6&#9; Hash of objects&#9;</I></FONT><A HREF="#_Toc446894797">*</A></P></DIR>
<B><FONT SIZE=2><P>4.&#9;POP processing&#9;</B></FONT><A HREF="#_Toc446894798">*</A></P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=4 COLOR="#0000ff"><A NAME="_Toc441640285"><A NAME="_Toc441640308"><A NAME="_Toc441640334"><A NAME="_Toc441640469"><A NAME="_Toc441645010"><A NAME="_Toc441647759"><A NAME="_Toc441915896"><A NAME="_Toc441919125"><A NAME="_Toc442155460"><A NAME="_Toc442155994"><A NAME="_Toc442165091"><A NAME="_Toc442261729"><A NAME="_Toc442263329"> <A NAME="_Toc446894773">REVISION LOG</A></A></A></A></A></A></A></A></A></A></A></A></A></A></P></B></FONT>
<TABLE BORDER CELLSPACING=1 BORDERCOLOR="#000000" CELLPADDING=7 WIDTH=710>
<TR><TD WIDTH="10%" VALIGN="TOP">
<P>Version</TD>
<TD WIDTH="10%" VALIGN="TOP">
<P>Date</TD>
<TD WIDTH="13%" VALIGN="TOP">
<P>Who</TD>
<TD WIDTH="67%" VALIGN="TOP">
<P>Description of change</TD>
</TR>
<TR><TD WIDTH="10%" VALIGN="TOP">
<P>1.0</TD>
<TD WIDTH="10%" VALIGN="TOP">
<P>1/25/99</TD>
<TD WIDTH="13%" VALIGN="TOP">
<P>K. Briggs</TD>
<TD WIDTH="67%" VALIGN="TOP">
<P>Created </TD>
</TR>
<TR><TD WIDTH="10%" VALIGN="TOP">
<P>1.0</TD>
<TD WIDTH="10%" VALIGN="TOP">
<P>1/29/99</TD>
<TD WIDTH="13%" VALIGN="TOP">
<P>K. Briggs</TD>
<TD WIDTH="67%" VALIGN="TOP">
<P>Modified to reflect release 1.0 of POP and include suggested examples.</TD>
</TR>
<TR><TD WIDTH="10%" VALIGN="TOP">
<P>1.1</TD>
<TD WIDTH="10%" VALIGN="TOP">
<P>2/24/99</TD>
<TD WIDTH="13%" VALIGN="TOP">
<P>T. Burzesi</TD>
<TD WIDTH="67%" VALIGN="TOP">
<UL>
<LI>Added section on Perl code required when you add attributes to a class as per email from B. Holzman. </LI>
<LI>Removed 3.10 on updating using diff: a practice no longer used.</LI>
<LI>Changed title to æDeveloperÆ Guide from User Guide.</UL>
</TD>
</TR>
</TABLE>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=4 COLOR="#0000ff"><P><A NAME="_Toc446894774">2.&#9;introduction</A></A></A></A></A></A></A></A></A></A></A></A></A></A> </P>
</B></FONT><P>Perl Object Persistence (POP) will be implemented by the PPS team using implicit persistence and with all information regarding persistent objects stored in a Sybase database. This user guide has been created to help the EEIT developer understand and utilize POP as implemented here at Matthew Bender on the PPS team. This user guide also describes many POP utilities and includes many explicit examples on their use for further clarification.</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=4 COLOR="#0000ff"><P><A NAME="_Toc441640280"><A NAME="_Toc441640303"><A NAME="_Toc441640329"><A NAME="_Toc441640464"><A NAME="_Toc441645003"><A NAME="_Toc441647750"><A NAME="_Toc441915885"><A NAME="_Toc441919114"><A NAME="_Toc442155448"><A NAME="_Toc442155982"><A NAME="_Toc442165079"><A NAME="_Toc442261715"><A NAME="_Toc442263315"><A NAME="_Toc446894775">3.&#9;pre-pop processing (&quot;Before you Pop&quot;)</A></A></A></A></A></A></A></A></A></A></A></A></A></A></P>
</B></FONT><P>This section describes the steps a developer will follow prior to utilizing POP.</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc441640281"><A NAME="_Toc441640304"><A NAME="_Toc441640330"><A NAME="_Toc441640465"><A NAME="_Toc441645004"><A NAME="_Toc441647751"><A NAME="_Toc441915886"><A NAME="_Toc441919115"><A NAME="_Toc442155449"><A NAME="_Toc442155983"><A NAME="_Toc442165080"><A NAME="_Toc442261716"><A NAME="_Toc442263316"><A NAME="_Toc446894776">3.1&#9;Familiarizing yourself with pox and poxen</A></A></A></A></A></A></A></A></A></A></A></A></A></A></P>
</B></FONT><P>POX* is a markup language conforming to the XML** specification which describes persistent class structure. WeÆll refer a single file containing pox as &quot;<B>pox</B>&quot; and a collection of pox files as &quot;<B>poxen</B>&quot; from this point forward in the documentation. </P>
<DIR>
<DIR>
<DIR>
<FONT SIZE=1 COLOR="#ff0000"><P>&#9;* <B>POX</B> is an acronym for <B>P</B>ersistent <B>O</B>bject <B>X</B>ml. &#9;<B>** XML</B> stands for e<B>X</B>tensible <B>M</B>arkup <B>L</B>anguage.</P></DIR>
</DIR>
</DIR>
</FONT><B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc441640282"><A NAME="_Toc441640305"><A NAME="_Toc441640331"><A NAME="_Toc441640466"><A NAME="_Toc441645005"><A NAME="_Toc441647752"><A NAME="_Toc441915887"><A NAME="_Toc441919116"><A NAME="_Toc442155450"><A NAME="_Toc442155984"><A NAME="_Toc442165081"><A NAME="_Toc442261717"><A NAME="_Toc442263317"><A NAME="_Toc446894777">3.2&#9;Using POX to describe a class.</A></A></A></A></A></A></A></A></A></A></A></A></A></A></P>
</B></FONT><P>Create a separate pox file for each new class you are attempting to describe/define. When creating a new pox file, the file name should be the name of the class youÆre defining and the file extension will always be &quot;pox&quot;. Our naming convention is:</P>
<P>&#9;&#9;<FONT FACE="Courier New">Employee_site.pox</P>
</FONT>
<P>where the class (&quot;Employee_site&quot; here) is the file name which always begins with a capital letter and may contain underscores for readability and with the aforementioned &quot;.pox&quot; file extension. A pox file should always contain information describing the class (such as name and abbreviated name if necessary), as well as information on attributes, methods, class-methods, method-parameters, and text format, if pertinent. The first line of a pox file should always contain a &quot;version&quot; tag used for project source control. A sample version tag would be:</P>
<P>&#9;</P>
<P>&#9;<B>&#9;</B><FONT FACE="Courier New">&lt;?version '$Revision: 1.1.1.1 $'?&gt;</P>
</FONT>
<P>This will keep the revision number up-to-date each and every time the pox is checked into CVS (Concurrent Versions System; our source control software used on the PPS team). It is not necessary to create a &quot;constructor&quot; as constructors will be inherited from the persistent base class. Any text found in the pox elements will be considered comments regarding the element and will appear in the documentation created from the pox files. (The procedure on how to generate html documentation from any text found in the pox appears later in this document in the section entitled: &quot;Create documentation using æpoxhtmlÆ&quot;). </P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>In addition to the aforementioned version tag, the pox file will also contain one or more pox elements which will each help to further define the class. Each pox element, as well as the attributes for each, should be as outlined in the following table:</P>
<TABLE BORDER CELLSPACING=2 BORDERCOLOR="#000000" CELLPADDING=7 WIDTH=655>
<TR><TD WIDTH="15%" VALIGN="TOP">
<B><FONT SIZE=3><P ALIGN="CENTER">Element</B></FONT></TD>
<TD WIDTH="16%" VALIGN="TOP">
<B><FONT SIZE=3><P ALIGN="CENTER">Parents</B></FONT></TD>
<TD WIDTH="21%" VALIGN="TOP">
<B><FONT SIZE=3><P ALIGN="CENTER">Attributes</B></FONT></TD>
<TD WIDTH="49%" VALIGN="TOP">
<B><FONT SIZE=3><P ALIGN="CENTER">Description</B></FONT></TD>
</TR>
<TR><TD WIDTH="15%" VALIGN="TOP">
<FONT SIZE=3><P>class</FONT></TD>
<TD WIDTH="16%" VALIGN="TOP">
<FONT SIZE=3><P>&lt;none&gt;</FONT></TD>
<TD WIDTH="21%" VALIGN="TOP">
<UL>
<FONT SIZE=3><LI>name</LI>
<LI>isa</LI></UL>
<UL>
<LI>abbr</FONT></TD>
<TD WIDTH="49%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>Should be identical to </FONT><FONT FACE="Courier" SIZE=3>Class_name</LI></P>
</FONT><FONT SIZE=3><P ALIGN="JUSTIFY"><LI>Comma-separated list of (fully-qualified) class names from which this class is derived.</LI></P>
<P ALIGN="JUSTIFY"><LI>Short version of name for use in database</UL>
</FONT></TD>
</TR>
<TR><TD WIDTH="15%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">attribute</FONT></TD>
<TD WIDTH="16%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">class</FONT></TD>
<TD WIDTH="21%" VALIGN="TOP">
<UL>
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>name</LI></P>
<P ALIGN="JUSTIFY"><LI>abbr</LI></P>
<P ALIGN="JUSTIFY"><LI>type</LI></P></UL>
<P ALIGN="JUSTIFY"></P>
<P ALIGN="JUSTIFY">&nbsp;</P>
<UL>
<P ALIGN="JUSTIFY"><LI>key_type</LI></P></UL>
<P ALIGN="JUSTIFY"></P>
<UL>
<P ALIGN="JUSTIFY"><LI>val_type</LI></P></UL>
<P ALIGN="JUSTIFY"></P>
<UL>
<P ALIGN="JUSTIFY"><LI>list</LI></P>
<P ALIGN="JUSTIFY"><LI>hash</LI></P>
<P ALIGN="JUSTIFY"><LI>default</FONT></TD>
<TD WIDTH="49%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>The name of the attribute, all lower-case</LI></P>
<P ALIGN="JUSTIFY"><LI>Short version of name for use in database</LI></P>
<P ALIGN="JUSTIFY"><LI>Either the database type or the (fully-qualified) class name if this is an embedded object attribute, unless hash is defined</LI></P>
<P ALIGN="JUSTIFY"><LI>type of the key if hash is defined (may _not_ be a class name)</LI></P>
<P ALIGN="JUSTIFY"><LI>type of the value if hash is defined (may be a class name)</LI></P>
<P ALIGN="JUSTIFY"><LI>1 if the attribute is a list</LI></P>
<P ALIGN="JUSTIFY"><LI>1 if the attribute is a hash</LI></P>
<P ALIGN="JUSTIFY"><LI>initial value of the attribute, if any (only if list and hash are not defined)</UL>
</FONT></TD>
</TR>
<TR><TD WIDTH="15%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">method</FONT></TD>
<TD WIDTH="16%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">class</FONT></TD>
<TD WIDTH="21%" VALIGN="TOP">
<UL>
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>name</FONT></TD>
<TD WIDTH="49%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>The name of the method, all lower-case</UL>
</FONT></TD>
</TR>
<TR><TD WIDTH="15%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">class-method</FONT></TD>
<TD WIDTH="16%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">class</FONT></TD>
<TD WIDTH="21%" VALIGN="TOP">
<UL>
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>name</FONT></TD>
<TD WIDTH="49%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>The name of the class method, all lower-case</UL>
</FONT></TD>
</TR>
<TR><TD WIDTH="15%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">constructor</FONT></TD>
<TD WIDTH="16%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">class</FONT></TD>
<TD WIDTH="21%" VALIGN="TOP">
<UL>
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>name</FONT></TD>
<TD WIDTH="49%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>The name of the constructor, all lower-case</UL>
</FONT></TD>
</TR>
<TR><TD WIDTH="15%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">param</FONT></TD>
<TD WIDTH="16%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">method, class-method, constructor</FONT></TD>
<TD WIDTH="21%" VALIGN="TOP">
<UL>
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>name</LI></P>
<P ALIGN="JUSTIFY"><LI>type</LI></P>
<P ALIGN="JUSTIFY"><LI>pos</FONT></TD>
<TD WIDTH="49%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>The name of the parameter, all lower-case</LI></P>
<P ALIGN="JUSTIFY"><LI>Either "scalar" or "array"</LI></P>
<P ALIGN="JUSTIFY"><LI>Number indicating which parameter this is on the stack</UL>
</FONT></TD>
</TR>
<TR><TD WIDTH="15%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">em</FONT></TD>
<TD WIDTH="16%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY">&lt;any&gt;</FONT></TD>
<TD WIDTH="21%" VALIGN="TOP">
<UL>
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>&lt;none&gt;</FONT></TD>
<TD WIDTH="49%" VALIGN="TOP">
<FONT SIZE=3><P ALIGN="JUSTIFY"><LI>Emphasizes the enclosed text (format)</UL>
</FONT></TD>
</TR>
</TABLE>
<P>&nbsp;</P>
<P>&nbsp;</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=2 COLOR="#000080"><P><A NAME="_Toc446894778">3.2.1</A>&#9;</P>
<P><A NAME="_Toc441915888"><A NAME="_Toc441919117"><A NAME="_Toc442155451"><A NAME="_Toc442155985"><A NAME="_Toc442165082"><A NAME="_Toc442261718"><A NAME="_Toc442263318"><A NAME="_Toc446894779">A sample written description of a hypothetical class:</A></A></A></A></A></A></A></A></P>
</B></FONT><P>LetÆs say we have a new upcoming project (codenamed &quot;Djakarta&quot;) and we determine that we have a need to define a class to represent companies with headquarters in the United States. Suppose we have a base-class which we may inherit from (LetÆs say the æDjakarta::corporationÆ class which describes international corporations). From our analysis, we realize that we have specific characteristics which we wish to keep regarding each of these US companies that is not necessarily already found in our base class such as:</P>
<UL>
<LI>company name.</LI>
<LI>Tax Identification Number (TIN) - [unique identifier provided by the U.S. government (IRS)].</LI>
<LI>USA address of headquarters.</LI>
<LI>Exporter of Goods (outside of the USA)?[Y/N].</LI>
<LI>Date company incorporated.</LI>
<LI>a list of products produced by the company.</LI>
<LI>a list of products and their associated product-codes.</LI></UL>
<P>The type of each of these variable attributes must be decided when creating the pox to define a class. The five major types recognized in the pox file are: numbers, strings, bits, dates and objects. </P>
<P>Our analysis also leads us to believe that Djakarta will need a way to perform the following operations: </P>
<UL>
<LI>Obtain a list of current employees for the US company having a specific TIN.</LI>
<LI>Obtain a list of subsidiaries of the US company from the primary companyÆs TIN. </LI>
<LI>Obtain the New York Stock Exchange acronym for the US company if traded on NYSE using TIN.</LI></UL>
<P>All of the aforementioned class attributes and class methods can easily be represented in a pox file which weÆll create to describe our class. In order to continue with our example, letÆs call our new class &quot;Us_company&quot;. If we were to represent this new class using pox, what do you suppose our pox file would look like? WeÆll show you a sample pox for the &quot;Us_company&quot; class on the next page.</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=2 COLOR="#000080"><P><A NAME="_Toc441915889"><A NAME="_Toc441919118"><A NAME="_Toc442155452"><A NAME="_Toc442155986"><A NAME="_Toc442165083"><A NAME="_Toc442261719"><A NAME="_Toc442263319"><A NAME="_Toc446894780">3.2.2&#9;A sample pox description of a hypothetical class (&quot;Us_company.pox&quot;):</A></A></A></A></A></A></A></A></P>
</B></FONT><FONT FACE="Courier New" SIZE=1><P>&lt;?version '$Revision: 1.1.1.1 $'?&gt;</P>
<P>&lt;class name=æUs_companyÆ isa=æDjakarta::CorporationÆ abbr=æuscoÆ&gt;</P>
<P> &#9;This United States Company class inherits from the Corporation class. This</P>
<P> &#9;class represents American companies that the Djakarta project will monitor.</P>
<P> &lt;attribute name='Company_name' type=ævarchar(255)Æ&gt;</P>
<P> &#9;This is the name of the Company headquartered in the United States.</P>
<P> &lt;/attribute&gt;</P>
<P> &lt;attribute name='Company_tin' type=æchar(11)Æ abbr=æemplr_idÆ&gt;</P>
<P> &#9;Unique Tax identification number (assigned by US govÆt/IRS). (e.g. æ123-45-0987Æ)</P>
<P> &lt;/attribute&gt;</P>
<P> &lt;attribute name=æUsa_Street_addressÆ type=ævarchar(255)Æ&gt;</P>
<P> &#9;This is the street address of company headquarters. (e.g. æ125 Main StreetÆ).</P>
<P> &lt;/attribute&gt;</P>
<P> &lt;attribute name=æUsa_CityÆ type=ævarchar(80)Æ&gt;</P>
<P> &#9;This is the City where the companyÆs headquarters is located.</P>
<P> &lt;/attribute&gt;</P>
<P> &lt;attribute name=æUsa_StateÆ type=æchar(2)Æ abbr=æSTÆ&gt;</P>
<P> &#9;This is the State (abbreviated; e.g. &quot;NY&quot;) where the companyÆs headquarters is located.</P>
<P> &lt;/attribute&gt;</P>
<P> &lt;attribute name=æUsa_ZipcodeÆ type=æchar(9)Æ abbr=æZipÆ&gt;</P>
<P> &#9;This is the zipcode for the companyÆs headquarters.</P>
<P> &lt;/attribute&gt;</P>
<P> &lt;attribute name=æUs_ExporterÆ type=æbitÆ default=æ0Æ&gt;</P>
<P> &#9;Boolean bit-flag to distinguish exporters (ship to outside US) from non-exporters.</P>
<P> &lt;/attribute&gt;</P>
<P> &lt;attribute name=æDate_incorporated type=ædatetimeÆ&gt;</P>
<P> &#9;This is the date the company was incorporated.</P>
<P> &lt;/attribute&gt;</P>
<P> &lt;attribute name=æProduct_listÆ list=æ1Æ type='Djakarta::Product'&gt;</P>
<P> &#9;List of products the Company produces. (Empty list for &quot;no products&quot;.)</P>
<P> &lt;/attribute&gt;</P>
<P> &lt;attribute name=æProduct_id_and_detailÆ key_type=æchar(10)Æ val_type=æDjakarta::ProductÆ hash=æ1Æ&gt;</P>
<P> &#9;Hash [keyed on product-id] of Product objects. Useful in retrieving specific product information</P>
<P>&#9;such as description, price, in-stock inventory, etc.</P>
<P> &lt;/attribute&gt;</P>
<P> &lt;class-method name='Current_Employees'&gt;</P>
<P> &lt;param name='Company_tin' type='char(10)' pos='1'&gt;</P>
<P> &#9;A Company_tin (tax id number) is passed as a parameter to this method.</P>
<P> &lt;/param&gt;</P>
<P> &#9;Method returns list of current employees for the Company-id passed in parm.</P>
<P> &lt;/method&gt;</P>
<P> &lt;class-method name='Subsidiaries'&gt;</P>
<P> &lt;param name='Company_tin' type='char(10)' pos='1'&gt;</P>
<P>&#9;A Company_tin (tax id number) is passed as a parameter to this method.</P>
<P> &lt;/param&gt;</P>
<P> &#9;Method returns list of subsidiary companies for the Company-id passed in parm.</P>
<P> &lt;/method&gt;</P>
<P> &lt;method name=æNYSE_Trading_InformationÆ&gt;</P>
<P> &lt;param name='Company_tin' type='char(10)' pos='1'&gt;</P>
<P>&#9;An Company_tin (tax id number) is passed as a parameter to this method.</P>
<P> &lt;/param&gt;</P>
<P> &#9;Returns the New York Stock Exchange acronym for US Company with TIN passed. </P>
<P> &lt;/method&gt;</P>
<P>&lt;/class&gt;</P>
</FONT><FONT SIZE=2>
<P>&nbsp;</P>
</FONT><P>Once a developer has created a pox file to describe a class (such as the &quot;Us_company&quot; class on the previous page) several utilities can be invoked which use pox/poxen as input. These utilities are described in detail later in this document. Prior to invoking these utilities, other preparations must be made such as the setting of several environment variables.</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc441640283"><A NAME="_Toc441640306"><A NAME="_Toc441640332"><A NAME="_Toc441640467"><A NAME="_Toc441645006"><A NAME="_Toc441647753"><A NAME="_Toc441915890"><A NAME="_Toc441919119"><A NAME="_Toc442155453"><A NAME="_Toc442155987"><A NAME="_Toc442165084"><A NAME="_Toc442261720"><A NAME="_Toc442263320"><A NAME="_Toc446894781">3.3&#9;Setting Environment Variables prior to processing poxen.</A></A></A></A></A></A></A></A></A></A></A></A></A></A></P>
</B></FONT><P>Several environment variables need to be set for each individual system before that system is able to use POP. These variables will use an <I>environment.template</I> file and the <I>create_environment</I> program to create an environment shell script. This script must be sourced prior to using the system. Please refer to the </P>
<P>PPS DeveloperÆs Guide for more information regarding the setting and use of the required POP environment variables. The following table outlines the names of the various POP environment variables and their purpose.</P>
<TABLE BORDER CELLSPACING=2 BORDERCOLOR="#000000" CELLPADDING=7 WIDTH=696>
<TR><TD WIDTH="50%" VALIGN="TOP">
<B><P>Environment Variable</B></TD>
<TD WIDTH="50%" VALIGN="TOP">
<B><P>Purpose</B></TD>
</TR>
<TR><TD WIDTH="50%" VALIGN="TOP">
<P>POXLIB</TD>
<TD WIDTH="50%" VALIGN="TOP">
<P>Specifies the directory where the poxen reside (especially those to be inherited from.)</TD>
</TR>
<TR><TD WIDTH="50%" VALIGN="TOP">
<P>SYBASE</TD>
<TD WIDTH="50%" VALIGN="TOP">
<P>Specifies the location of the sybase client library (e.g. &quot;/sybase/server11p&quot; on albsun4 or &quot;/opt/sybase&quot; on albsun9.)</TD>
</TR>
<TR><TD WIDTH="50%" VALIGN="TOP">
<P>DBI_DRIVER</TD>
<TD WIDTH="50%" VALIGN="TOP">
<P>Specifies which DBI driver to use. (Should be "Sybase" for current POP processing.)</TD>
</TR>
<TR><TD WIDTH="50%" VALIGN="TOP">
<P>DB_SERVER</TD>
<TD WIDTH="50%" VALIGN="TOP">
<P>Specifies which database server to use. (Currently </P>
<P>"albsun2_sql11_dev" for the development server and "albsun8_sql11_prd" for the production server.)</P>
<B></B></TD>
</TR>
<TR><TD WIDTH="50%" VALIGN="TOP">
<P>DB_DB</TD>
<TD WIDTH="50%" VALIGN="TOP">
<P>Specifies which database to use in the DB_SERVER server. (For fez, "fez_dbdata_dev" in development, "fez_dbdata_prd" in production.)</TD>
</TR>
<TR><TD WIDTH="50%" VALIGN="TOP">
<P>DB_USER</TD>
<TD WIDTH="50%" VALIGN="TOP">
<P>Specifies user name to connect to database as.</TD>
</TR>
<TR><TD WIDTH="50%" VALIGN="TOP">
<P>DB_PASSWD</TD>
<TD WIDTH="50%" VALIGN="TOP">
<P>Specifies password for DB_USER</TD>
</TR>
<TR><TD WIDTH="50%" VALIGN="TOP">
<P>POX_SYSTEM</TD>
<TD WIDTH="50%" VALIGN="TOP">
<P>Specifies system name with first letter always capitalized. (For fez, would be "Fez".)</TD>
</TR>
</TABLE>
<P>&nbsp;</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc446894782">3.4</A>&#9;</P>
<P><A NAME="_Toc442155454"><A NAME="_Toc442155988"><A NAME="_Toc442165085"><A NAME="_Toc442261721"><A NAME="_Toc442263321"><A NAME="_Toc446894783">Understanding how the pox utilities parse their parameters</A></A></A></A></A></A></P>
</B></FONT><P>The major pox utilities (poxhtml, poxperl and poxdb) all use the same code to parse the parameters they are passed. This section will take advantage of that fact and explain the way arguments are handled for these utilities all at once. The major pox utilities accept parameters primarily in the following ways:</P>
<UL>
<LI>a matching set of files (one input [pox] file &amp; a corresponding output file[utility determines format].)</LI>
<LI>a matching set of directories (one input directory [poxen-filled] &amp; one output directory.)</LI>
<LI>multiple matching sets of files (<I>n</I> input [pox] files &amp; <I>n</I> corresponding output files.)</LI></UL>
<P>In the case of arguments passed in <I>a matching set of files</I>, consider the following example:</P>
<P>&#9;<B><FONT FACE="Courier New">poxhtml Us_company.pox -out Us_company.html</FONT> </P>
</B>
<P>When we dissect the example we find the utility name (&quot;poxhtml&quot;), followed by the name of a single pox file (&quot;Us_company.pox&quot;), which is followed by the switch (&quot;-out&quot;), which is in turn followed by the name of the requested output file (&quot;Us_company.html&quot;, in this case). In this example, the utility poxhtml will take the Us_company.pox file found in the current directory and from the pox and comments found inside it will generate a documentation file in html format which will be placed in the Us_company.html output file. </P>
<P>In the case of arguments passed in <I>a matching set of directories</I>, consider the following example:</P>
<P>&#9;<B><FONT FACE="Courier New">poxperl Djakarta/pox/ -out Djakarta/lib</FONT> </P>
</B>
<P>When we dissect the example we find the utility name (&quot;poxperl&quot;), followed by the name of a poxen directory (&quot;Djakarta/pox&quot;) which is followed by the switch (&quot;-out&quot;), which is in turn followed by the name of the requested output directory (&quot;Djakarta/lib&quot;, in this case). In this example, each individual pox file that the poxperl utility finds in the input directory will be processed and will have a corresponding like-named output file placed in the output directory. </P>
<P>In the case of arguments passed as <I>multiple matching sets of files</I>, consider the following example:</P>
<P>&#9;<B><FONT FACE="Courier New">poxdb Employee.pox -out Employee.schema Car.pox -out Car.schema</FONT><FONT SIZE=3> </P>
</B></FONT>
<P>When we dissect the example we find the utility name (&quot;poxdb&quot;), followed by the name of the first pox input file (&quot;Employee.pox&quot;) which is followed by the switch (&quot;-out&quot;), which is in turn followed by the name of the first requested output file (&quot;Employee.schema&quot;, in this case). This matched set of files is then followed by another pox input file (&quot;Car.pox&quot;) which is followed by another switch (&quot;-out&quot;) and the corresponding output file (&quot;Car.schema&quot; in this case.) In this example, each individual pox file that the poxdb utility finds as an input file parameter (i.e. not preceded by an &quot;-out&quot; switch) will be processed and will have an output file placed in the corresponding output file (i.e. the parameter which follows the previous input file and &quot;-out&quot; switch.) Note that any number of multiple matching sets of files can be passed as parameters as long as the arguments are passed in the scheme illustrated by the example above.</P>
<P>&nbsp;</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc441640284"><A NAME="_Toc441640307"><A NAME="_Toc441640333"><A NAME="_Toc441640468"><A NAME="_Toc441645007"><A NAME="_Toc441647754"><A NAME="_Toc441915891"><A NAME="_Toc441919120"><A NAME="_Toc442155455"><A NAME="_Toc442155989"><A NAME="_Toc442165086"><A NAME="_Toc442261722"><A NAME="_Toc442263322"><A NAME="_Toc446894784">3.5&#9;Creating documentation using &quot;poxhtml&quot;</A></A></A></A></A></A></A></A></A></A></A></A></A></A></P>
</B></FONT><P>A utility named &quot;poxhtml&quot; is used by PPS developers to create documentation in html format. This utility should be invoked from the root of the developerÆs working directory. &quot;Poxhtml&quot; takes one or more pox files as input and creates a corresponding html output file for each pox file found as input. (Please see the section on &quot;Understanding how the pox utilities parse their parameters&quot; for examples on how to invoke this utility with parameters.) Each html output file will contain the name of the class encountered in the pox file at the highest heading level. Any classes from which this class is derived will also be found in the html output file. The name of each base class will be a hyperlink to the page for that class. Sections will be created for attributes, methods, class-methods and constructors. Underneath each of the aforementioned sections will be the corresponding elements of that type (inherited or otherwise). Also, any types which are actually class names will be hyperlinks to the page for that class.</P>
<FONT FACE="Courier New"><P>&nbsp;</P>
</FONT><B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc441645008"><A NAME="_Toc441647755"><A NAME="_Toc441915892"><A NAME="_Toc441919121"><A NAME="_Toc442155456"><A NAME="_Toc442155990"><A NAME="_Toc442165087"><A NAME="_Toc442261723"><A NAME="_Toc442263323"><A NAME="_Toc446894785">3.6&#9;Creating Perl modules using &quot;poxperl&quot;</A></A></A></A></A></A></A></A></A></A></P>
</B></FONT><P>A utility named &quot;poxperl&quot; takes pox file(s) as input and converts each class definition encountered into a perl module which begins the implementation of that class. The developer is responsible for making sure that POP environment variables are set correctly for the current project prior to running &quot;poxperl&quot;. (Please see the section on &quot;Setting Environment Variables prior to processing poxen&quot;.) The output perl module is created but could be considered more of a &quot;skeleton&quot; in that it is up to the developer to modify the module in such a way as to fully implement the class.. (i.e. methods found in pox files will contain parameters for a method but would not necessarily contain the perl code for the method.) One perl module will be created for each pox file found as an input parameter. (Please see the section on &quot;Understanding how the pox utilities parse their parameters&quot; for examples on how to invoke this utility with parameters.)</P>
<FONT FACE="Courier New">
<P>&nbsp;</P>
<P>&nbsp;</P>
</FONT><B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc441645009"><A NAME="_Toc441647756"><A NAME="_Toc441915893"><A NAME="_Toc441919122"><A NAME="_Toc442155457"><A NAME="_Toc442155991"><A NAME="_Toc442165088"><A NAME="_Toc442261724"><A NAME="_Toc442263324"><A NAME="_Toc446894786">3.7&#9;Creating database schema using &quot;poxdb&quot;</A></A></A></A></A></A></A></A></A></A></P>
</B></FONT><P>A utility named &quot;poxdb&quot; takes pox file(s) as input and converts each class definition encountered into the schemata necessary to provide object persistence for each class. One schema file will be created for each pox input file passed as a parameter. (Please see the section on &quot;Understanding how the pox utilities parse their parameters&quot; for examples on how to invoke this utility with parameters.) </P>
<P>&nbsp;</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc441647758"><A NAME="_Toc441915895"><A NAME="_Toc441919124"><A NAME="_Toc442155458"><A NAME="_Toc442155992"><A NAME="_Toc442165089"><A NAME="_Toc442261725"><A NAME="_Toc442263325"><A NAME="_Toc446894787">3.8&#9;Using &quot;schemadrop&quot;</A></A></A></A></A></A></A></A></A></P>
</B></FONT><P>A utility named &quot;schemadrop&quot; is used when a developer wishes to drop a particular class or group of classes. Please note that before schema is &quot;dropped&quot; or tables are dropped, responsible developers will consider what data in the database, if any, must be retained. Regardless of the environment (test, certification, or, most notably production) the This utility will drop all tables, indices and stored procedures associated with the schema passed as input. If an error occurs during &quot;schemadrop&quot;, a message will be displayed for each error and processing will continue. The &quot;schemadrop&quot; utility can be passed a single schema file or a directory full of schema files (where the asterisk [*] is used as a wildcard symbol meaning &quot;all æ*.schemaÆ files found in the specified directory.) When &quot;Schemadrop&quot; is passed an entire directory as a parameter, it will drop all the schema associated with each of the files with &quot;schema&quot; file-extensions. A sample invocation with a single schema file passed as a parameter might be:</P>
<P>&#9;<B><FONT FACE="Courier New">schemadrop db/Car.schema</FONT><FONT SIZE=3> </P>
</B></FONT><P>whereas a sample invocation with a directory parameter might be:</P>
<P>&#9;<B><FONT FACE="Courier New">schemadrop db/*</FONT><FONT SIZE=3> </P>
</B></FONT><FONT FACE="Courier New"><P>&nbsp;</P>
</FONT><P><A NAME="_Toc446894788"><A NAME="_Toc441647757"><A NAME="_Toc441915894"><A NAME="_Toc441919123"><A NAME="_Toc442155459"><A NAME="_Toc442155993"><A NAME="_Toc442165090">3.9</A>&#9;</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc442261726"><A NAME="_Toc442263326"><A NAME="_Toc446894789">Using &quot;schemaload&quot;</A></A></A></A></A></A></A></A></A></P>
</B></FONT><P>A utility named &quot;schemaload&quot; is used when a developer wishes to incorporate the schema output from the most recent &quot;poxdb&quot; run into the database in the developerÆs environment of choice. If an error occurs during &quot;schemaload&quot;, a message will be displayed and processing is halted. The developer is then responsible for making corrections to the schema or pox files and re-attempting a &quot;schemaload&quot;. The &quot;schemaload&quot; utility can be passed a single schema file or a directory full of schema files (where the asterisk [*] is used as a wildcard symbol meaning &quot;all æ*.schemaÆ files found in the specified directory.) A sample invocation with a single schema file passed as a parameter might be:</P>
<P>&#9;<B><FONT FACE="Courier New">schemaload db/Car.schema</FONT><FONT SIZE=3> </P>
</B></FONT><P>which will load the schema (Car.schema, in this case) into the database specified by the current values in the environment variables whereas a sample invocation with a directory parameter might be:</P>
<P>&#9;<B><FONT FACE="Courier New">schemaload db/*</FONT><FONT SIZE=3> </P>
</B></FONT><FONT FACE="Courier New">
</FONT><P>which will load the schema (all schema files found in the db directory, in this case) into the database specified by the current values in the environment variables.</P>
<P>&nbsp;</P>
<B><STRIKE><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc442261727"><A NAME="_Toc442263327"><A NAME="_Toc446894790">3.10&#9;Merging pox changes with an updated perl module</A></A></A></P>
</B></FONT>
<P>In the event that developers find the need to change pox/poxen after they have already modified the perl modules output by &quot;poxperl&quot; they must be careful not to lose the perl code theyÆve developed. We recommend that the developer perform the following steps to ensure that no code is lost:</P>
<OL>
<LI>Create original pox file to describe and define a class.</LI>
<LI>Perform a &quot;check-in&quot; of the pox file into the CVS source code repository. (cvs &quot;add&quot;, then &quot;commit&quot;.)</LI>
<LI>Use the poxperl utility to generate a &quot;skeleton&quot; perl module. (e.g. &quot;Us_company.pm&quot;).</LI>
<LI>Modify the perl module expanding methods to attempt to fully implement the class.</LI>
<LI>Perform a &quot;check-in&quot; of the perl module into the CVS source code repository. (cvs &quot;add&quot;, then &#9;&quot;commit&quot;)</LI>
<LI>If changes are deemed necessary at this point, then change the pox file (e.g.&quot;Us_company.pox&quot;) as &#9;you have all of your work saved in CVS.</LI>
<LI>Perform a &quot;check-in&quot; of the new pox file into the CVS source code repository. (cvs &quot;add&quot;, then &#9;&quot;commit&quot; and the use of a version tag is recommended here.)</LI>
<LI>Run poxperl again (this time on the new pox file.)</LI>
<LI>Check the old-version of the perl module out of CVS into a temporary file (e.g.&quot;Temp_Us_co.pm&quot;).</LI>
<LI>Run a UNIX &quot;diff&quot; to obtain the difference between the temporary file and the new perl module and &#9;pipe it to a &quot;patch&quot; file.</LI>
<LI>Run a UNIX &quot;patch&quot; command to patch the patch-file changes into the new perl module code.</LI></OL>
<P>This process should save you from losing valuable perl code.</P>
</STRIKE><B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" COLOR="#008080"><P><A NAME="_Toc446894791">3.11&#9;Perl class code required when you add an attribute to your class</A></P>
</B></FONT><P>When adding an attribute, you must create an accessor for it and add </P>
<P> it to the initialize method. These are the rules you must follow, </P>
<P> based on the type of the attribute. </P>
<P>In the examples which follow, the </P>
<P> attribute name will be 'attr', the system name will be 'System' and </P>
<P> the class for which we are adding the 'attr' attribute will be </P>
<P> 'Class'.</P>
<P> </P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=2 COLOR="#000080"><P><A NAME="_Toc446894792">3.11.1&#9; Scalar non-object</A></P>
</B></FONT><P> </P>
<P> ACCESSOR:</P>
<P> </P>
<P> =head2 ACCESSOR</P>
<P> Title: System::Class::attr</P>
<P> Desc: Description of 'attr' attribute</P>
<P> =cut</P>
<P> </P>
<P> sub attr {</P>
<P> my $this = shift;</P>
<P> if (@_) {</P>
<P> my $obj = shift;</P>
<P> $this-&gt;{'attr'} = $obj;</P>
<P> }</P>
<P> $this-&gt;{'attr'};</P>
<P> }</P>
<P> </P>
<P> INITIALIZE:</P>
<P> </P>
<P> $this-&gt;{'attr'} = '';</P>
<P> </P>
<P> ---</P>
<P> </P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=2 COLOR="#000080"><P><A NAME="_Toc446894793">3.11.2&#9; Scalar object</A> </P>
</B></FONT><P> This example uses a scalar embedded (has-a) object of class æSystem::FooÆ</P>
<P> ACCESSOR:</P>
<P> </P>
<P> =head2 ACCESSOR</P>
<P> Title: System::Class::attr</P>
<P> Desc: Description of 'attr' attribute</P>
<P> =cut</P>
<P> </P>
<P> sub attr {</P>
<P> my $this = shift;</P>
<P> if (@_) {</P>
<P> my $obj = shift;</P>
<P> unless (ref($obj) &amp;&amp; UNIVERSAL::isa($obj, 'System::Foo')) {</P>
<P> croak "[$obj] is not a System::Foo object";</P>
<P> }</P>
<P> $this-&gt;{'attr'} = \$obj;</P>
<P> }</P>
<P> ${$this-&gt;{'attr'}};</P>
<P> }</P>
<P> </P>
<P> INITIALIZE:</P>
<P> </P>
<P> $this-&gt;{'attr'} = \do{my $a};</P>
<P> </P>
<P> ---</P>
<P> </P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=2 COLOR="#000080"><P><A NAME="_Toc446894794">3.11.3&#9; List of non-objects</A></P>
</B></FONT><P> This example assumes a list of type æintÆ</P>
<P> ACCESSOR:</P>
<P> </P>
<P> =head2 ACCESSOR</P>
<P> Title: System::Class::attr</P>
<P> Desc: Description of 'attr' attribute</P>
<P> =cut</P>
<P> </P>
<P> sub attr {</P>
<P> my $this = shift;</P>
<P> if (@_) {</P>
<P> $this-&gt;{'attr'} = [@_];</P>
<P> }</P>
<P> wantarray ? @{$this-&gt;{'attr'}} : $this-&gt;{'attr'};</P>
<P> }</P>
<P> </P>
<P> INITIALIZE:</P>
<P> </P>
<P> $this-&gt;{'attr'} =</P>
<P> $this-&gt;_POP__Persistent_list_from_db('int', 'attr');</P>
<P> </P>
<P> </P>
<P> </P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=2 COLOR="#000080"><P><A NAME="_Toc446894795">3.11.4&#9; List of objects</A></P>
</B></FONT><P> This example uses a list of embedded (has-a) objects of class æSystem::FooÆ</P>
<P>ACCESSOR:</P>
<P> </P>
<P> =head2 ACCESSOR</P>
<P> Title: System::Class::attr</P>
<P> Desc: Description of 'attr' attribute</P>
<P> =cut</P>
<P> </P>
<P> sub attr {</P>
<P> my $this = shift;</P>
<P> if (@_) {</P>
<P> foreach (@_) {</P>
<P> unless (ref($_) &amp;&amp; UNIVERSAL::isa($_, 'System::Foo')) {</P>
<P> croak "[$_] is not a System::Foo object";</P>
<P> }</P>
<P> }</P>
<P> $this-&gt;{'attr'} = [@_];</P>
<P> }</P>
<P> wantarray ? @{$this-&gt;{'attr'}} : $this-&gt;{'attr'};</P>
<P> }</P>
<P> </P>
<P> INITIALIZE:</P>
<P> </P>
<P> $this-&gt;{'attr'} =</P>
<P> $this-&gt;_POP__Persistent_list_from_db('System::Foo', 'attr');</P>
<P> </P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=2 COLOR="#000080"><P><A NAME="_Toc446894796">3.11.5&#9; Hash of non-objects</A></P>
</B></FONT><P>This example uses a hash of strings (char 30)</P>
<P> ACCESSOR:</P>
<P> </P>
<P> =head2 ACCESSOR</P>
<P> Title: System::Class::attr</P>
<P> Desc: Description of 'attr' attribute</P>
<P> =cut</P>
<P> </P>
<P> sub attr {</P>
<P> my $this = shift;</P>
<P> if (@_) {</P>
<P> my %hash = @_;</P>
<P> $this-&gt;{'attr'} = \%hash;</P>
<P> }</P>
<P> wantarray ? %{$this-&gt;{'attr'}} : $this-&gt;{'attr'};</P>
<P> }</P>
<P> </P>
<P> INITIALIZE:</P>
<P> </P>
<P> $this-&gt;{'attr'} =</P>
<P> $this-&gt;_POP__Persistent_hash_from_db('char(30)', 'attr', {});</P>
<P> </P>
<P> ---</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=2 COLOR="#000080"><P><A NAME="_Toc446894797">3.11.6&#9; Hash of objects</A></P>
</B></FONT><P>This example uses a hash of embedded objects, of type 'System::Foo'</P>
<P> </P>
<P> ACCESSOR:</P>
<P> </P>
<P> =head2 ACCESSOR</P>
<P> Title: System::Class::attr</P>
<P> Desc: Description of 'attr' attribute</P>
<P> =cut</P>
<P> </P>
<P> sub attr {</P>
<P> my $this = shift;</P>
<P> if (@_) {</P>
<P> my %hash = @_;</P>
<P> while (my($k,$v) = each %hash) {</P>
<P> unless (ref($v) &amp;&amp; UNIVERSAL::isa($v, 'System::Foo') {</P>
<P> croak "[$v] is not a System::Foo object";</P>
<P> }</P>
<P> }</P>
<P> $this-&gt;{'attr'} = \%hash;</P>
<P> }</P>
<P> wantarray ? %{$this-&gt;{'attr'}} : $this-&gt;{'attr'};</P>
<P> }</P>
<P> </P>
<P> INITIALIZE:</P>
<P> </P>
<P> $this-&gt;{'attr'} =</P>
<P> $this-&gt;_POP__Persistent_hash_from_db('System::Foo', 'attr', {});</P>
<P>&nbsp;</P>
<B><FONT FACE="Century Schoolbook,ChelthmITC Bk BT" SIZE=4 COLOR="#0000ff"><P><A NAME="_Toc442261728"><A NAME="_Toc442263328"><A NAME="_Toc446894798">4.&#9;POP processing</A></A></A></P>
</B></FONT>
<P></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></A></P>
</BODY>
</HTML>