Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bd5c3d824c3db63ffd9226c15941e6ad > files > 114

mozart-1.4.0-1mdv2010.0.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>6 Application Deployment</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node6.html#chapter.mof">&lt;&lt; Prev</A></TD><TD><A href="node1.html">- Up -</A></TD></TR></TABLE><DIV id="chapter.deployment"><H1><A name="chapter.deployment">6 Application Deployment</A></H1><DIV id="section.deployment.linking"><H2><A name="section.deployment.linking">6.1 Linking Functors</A></H2><P> Application development can be considerably eased by splitting the application in a large number of orthogonal and reusable functors. However, deployment of an application gets harder in the presence of a large number of functors: </P><OL type="1"><LI><P>Installing the application requires correct installation of a large number of functors. </P></LI><LI><P>Execution might be slow due to frequent file- or even network accesses. </P></LI></OL><P> </P><P> The commandline tool <KBD>ozl</KBD> eases deployment by creating a new functor that includes imported functors in a prelinked fashion: it is possible to collapse a collection of functors into a single equivalent one. The model that should be kept in mind, is that the newly created functor employs an internal, private module manager that executes the toplevel application functor together with all included functors. </P><P> The linker can be invoked on the input functor <CODE><I>In</I></CODE> in order to create an output functor <CODE><I>Out</I></CODE> as follows: </P><BLOCKQUOTE class="code"><CODE>ozl&nbsp;</CODE><CODE><I>In</I></CODE><CODE>&nbsp;-o&nbsp;</CODE><CODE><I>Out</I></CODE></BLOCKQUOTE><P> </P><P> For example, from the pickled toplevel functor <CODE>LMF.ozf</CODE> a new functor can be created as follows: </P><BLOCKQUOTE class="code"><CODE>ozl&nbsp;LMF.ozf&nbsp;-o&nbsp;LMF.oza</CODE></BLOCKQUOTE><P> where the pickled functor <CODE>LMF.ozf</CODE> is created by compilation as follows: </P><BLOCKQUOTE class="code"><CODE>ozc&nbsp;-c&nbsp;LMF.oz&nbsp;-o&nbsp;LMF.ozf</CODE></BLOCKQUOTE><P> </P><P> Now the newly created pickled functor <CODE>LMF.oza</CODE> can be installed everywhere, the functors stored in <CODE>DB.ozf</CODE> and <CODE>Form.ozf</CODE> are included in <CODE>LMF.oza</CODE>. </P><P> The linker can be used in verbose mode with the option <CODE>--verbose</CODE> (or <CODE>-v</CODE> as abbreviation). In verbose mode the linker prints information on which functors are included and which functors are imported by the newly created functor. For example, </P><BLOCKQUOTE class="code"><CODE>ozl&nbsp;-v&nbsp;LMF.ozf&nbsp;-o&nbsp;LMF.oza</CODE></BLOCKQUOTE><P> prints something like </P><BLOCKQUOTE class="code"><CODE>Include:<BR>&nbsp;&nbsp;&nbsp;/home/schulte/DB.ozf,&nbsp;/home/schulte/Form.ozf,<BR>&nbsp;&nbsp;&nbsp;/home/schulte/LMF.ozf.<BR>Import:<BR>&nbsp;&nbsp;&nbsp;x-oz://system/Application.ozf,&nbsp;x-oz://system/System.ozf,&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;x-oz://system/Tk.ozf.</CODE></BLOCKQUOTE><P> </P><P> The linker also supports options that control which functors are included, for more information see <A href="../tools/node7.html#chapter.linker">Chapter&nbsp;3 of ``Oz Shell Utilities''</A>. </P></DIV><DIV id="section.deployment.compressed"><H2><A name="section.deployment.compressed">6.2 Compressed Pickled Functors</A></H2><P> Pickles created by the compiler and linker can also take advantage of compression. For that matter, both tools support the <CODE>--compress</CODE> (or <CODE>-z</CODE> as shortcut) option that must be followed by a single digit that defines the compression level to be used. </P><P> For example, the pickled functor <CODE>LMF.oza</CODE> can be created compressed by </P><BLOCKQUOTE class="code"><CODE>ozl&nbsp;--compress&nbsp;9&nbsp;LMF.ozf&nbsp;-o&nbsp;LMF.oza</CODE></BLOCKQUOTE><P> This reduces the used disk space by 50%. </P></DIV><DIV id="section.deployment.execute"><H2><A name="section.deployment.execute">6.3 Executing Functors</A></H2><P> This section shows a convenient form to execute functors. </P><P> The option <CODE>--exec</CODE> (or <CODE>-x</CODE> as shortcut) can be supplied to both compiler and linker. Functors that are created with that option can be directly executed. For example, the file <CODE>lmf.exe</CODE> created with </P><BLOCKQUOTE class="code"><CODE>ozl&nbsp;-x&nbsp;LMF.ozf&nbsp;-o&nbsp;lmf.exe</CODE></BLOCKQUOTE><P> can be directly executed: </P><BLOCKQUOTE class="code"><CODE>lmf.exe</CODE></BLOCKQUOTE><P> The pickled functor <CODE>lmf.exe</CODE> just features a particular header that allows direct execution. It can still be used together with the <CODE>ozengine</CODE> program: </P><BLOCKQUOTE class="code"><CODE>ozengine&nbsp;lmf.exe</CODE></BLOCKQUOTE><P> </P><P> Naturally, the extension <CODE>.exe</CODE> can be omitted under Unix. </P></DIV></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node6.html#chapter.mof">&lt;&lt; Prev</A></TD><TD><A href="node1.html">- Up -</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys&nbsp;Duchier</A>, <A href="http://www.ps.uni-sb.de/~kornstae/">Leif&nbsp;Kornstaedt</A> and&nbsp;<A href="http://www.ps.uni-sb.de/~schulte/">Christian&nbsp;Schulte</A><BR><SPAN class="version">Version 1.4.0 (20090610)</SPAN></ADDRESS></BODY></HTML>