Componentes.Terceros.RemObj.../official/5.0.23.613/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.Sample.html

41 lines
1.7 KiB
HTML

<html>
<head>
<link rel="stylesheet" type="text/css" href="..\styles.css">
</head>
<body>
<img src="..\..\ro.png" alt="" align="right">
<!-------------------------------------------------------------------------->
<p class="h1">
<span>Class Factories</span>
</p>
<h2>Purpose</h2><p>This example shows how to use a <strong>Class Factory </strong>to generate three types of
server:</p>
<ul>
<li><strong>Singleton</strong>: all clients access a single server object.</li>
<li><strong>Single Call</strong>: server instances are created on demand and destroyed after processing the method call.</li>
<li><strong>Pooled</strong>: multiple server instances are accessible by clients. This
factory works exactly the same as Singleton, unless the first server instance is
busy.</li></ul>
<p>
<strong>Note</strong>: to test this sample properly, you need to run at least two clients.
</p>
<p>
</p>
<h2>
Examine the Code</h2>
<ul>
<li>See how the three services were defined by editing the service library. Do this by making the <strong>server</strong>
the selected project and by using the menu option: <strong>RemObjects | Edit Service Library</strong>.
<br />
<strong>Note</strong>: if you don't see this menu option but see 'Service Builder' instead,
you still have the client set as the current project.</li>
<li>The implementation of the three server types is held in three Impl.pas files: <strong>SingletonService_Impl</strong>,
<strong>SingleCallService_Impl</strong> and <strong>PooledService_Impl</strong>.</li>
<li>Examine the simple code needed to invoke the methods in <strong>ClassFactoryClientMain.pas</strong>. </li>
</ul>
</body>
</html>