You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by bu...@apache.org on 2014/01/19 16:38:14 UTC

svn commit: r894757 - in /websites/staging/isis/trunk: cgi-bin/ content/ content/applib-guide/domain-services/ content/applib-guide/how-tos/

Author: buildbot
Date: Sun Jan 19 15:38:13 2014
New Revision: 894757

Log:
Staging update by buildbot for isis

Modified:
    websites/staging/isis/trunk/cgi-bin/   (props changed)
    websites/staging/isis/trunk/content/   (props changed)
    websites/staging/isis/trunk/content/applib-guide/domain-services/about.html
    websites/staging/isis/trunk/content/applib-guide/domain-services/how-to-09-010-How-to-register-domain-services,-repositories-and-factories.html
    websites/staging/isis/trunk/content/applib-guide/domain-services/how-to-09-020-How-to-write-a-typical-domain-service.html
    websites/staging/isis/trunk/content/applib-guide/how-tos/how-to-01-010-How-to-have-a-domain-object-be-a-POJO.html
    websites/staging/isis/trunk/content/documentation.html

Propchange: websites/staging/isis/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Jan 19 15:38:13 2014
@@ -1 +1 @@
-1559504
+1559511

Propchange: websites/staging/isis/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Jan 19 15:38:13 2014
@@ -1 +1 @@
-1559504
+1559511

Modified: websites/staging/isis/trunk/content/applib-guide/domain-services/about.html
==============================================================================
--- websites/staging/isis/trunk/content/applib-guide/domain-services/about.html (original)
+++ websites/staging/isis/trunk/content/applib-guide/domain-services/about.html Sun Jan 19 15:38:13 2014
@@ -296,8 +296,7 @@ other.</p>
 <p>How-to's:</p>
 
 <ul>
-<li><a href="./how-to-09-010-How-to-register-domain-services,-repositories-and-factories.html">How to register domain services, repositories and factories</a></li>
-<li><a href="./how-to-09-020-How-to-write-a-typical-domain-service.html">How to write a typical domain service</a></li>
+<li><a href="./how-to-09-020-How-to-write-a-typical-domain-service.html">Singleton &amp; request-scoped services</a></li>
 <li><a href="./how-to-09-030-How-to-use-a-generic-repository.html">How to use a generic repository</a></li>
 <li><a href="./how-to-09-040-How-to-write-a-custom-repository.html">How to write a custom repository</a></li>
 <li><a href="./how-to-09-050-How-to-use-Factories.html">How to use Factories</a></li>

Modified: websites/staging/isis/trunk/content/applib-guide/domain-services/how-to-09-010-How-to-register-domain-services,-repositories-and-factories.html
==============================================================================
--- websites/staging/isis/trunk/content/applib-guide/domain-services/how-to-09-010-How-to-register-domain-services,-repositories-and-factories.html (original)
+++ websites/staging/isis/trunk/content/applib-guide/domain-services/how-to-09-010-How-to-register-domain-services,-repositories-and-factories.html Sun Jan 19 15:38:13 2014
@@ -279,15 +279,28 @@
 
 <h2>How to register domain services, repositories and factories</h2>
 
-<p>All domain services (which includes repositories and factories) should be registered in the <code>isis.properties</code> configuration file, under the <code>isis.services.prefix</code> (a common package name) and <code>isis.services</code> key (a comma-separated list).</p>
+<p>All domain services (which includes repositories and factories) should be registered in the <code>isis.properties</code> configuration file, under the <code>isis.services</code> key (a comma-separated list).</p>
 
 <p>For example:</p>
 
-<pre><code>isis.services.prefix = org.apache.isis.support.prototype.objstore.dflt
-isis.services = employee.EmployeeRepositoryDefault, claim.ClaimRepositoryDefault
+<pre><code>isis.services = com.mycompany.myapp.employee.Employees\,
+                com.mycompany.myapp.claim.Claims\,
+                ...
 </code></pre>
 
-<p>This will instantiate a single instance of each of the two services listed.</p>
+<p>This will then result in the framework instantiating a single instance of each of the services listed.</p>
+
+<p>If all services reside under a common package, then the <code>isis.services.prefix</code> can specify this prefix:</p>
+
+<pre><code>isis.services.prefix = com.mycompany.myapp
+isis.services = employee.Employees,\
+                claim.Claims,\
+                ...
+</code></pre>
+
+<p>This is quite rare, however; you will often want to use default implementations of domain services that are provided by the framework and so will not reside under this prefix.</p>
+
+<p>Examples of framework-provided services (as defined in the applib) can be found referenced from the main <a href="../../documentation.html">documentation</a> page.   They include clock, auditing, publishing, exception handling, view model support, snapshots/mementos, and user/application settings management.</p>
 
 
 

Modified: websites/staging/isis/trunk/content/applib-guide/domain-services/how-to-09-020-How-to-write-a-typical-domain-service.html
==============================================================================
--- websites/staging/isis/trunk/content/applib-guide/domain-services/how-to-09-020-How-to-write-a-typical-domain-service.html (original)
+++ websites/staging/isis/trunk/content/applib-guide/domain-services/how-to-09-020-How-to-write-a-typical-domain-service.html Sun Jan 19 15:38:13 2014
@@ -277,20 +277,52 @@
 </h1>
 </div>
 
-<h2>How to write a typical domain service</h2>
+<h2>Singleton &amp; request-scoped domain services</h2>
 
-<p>Services consist of a set of logically grouped actions, and as such follow the same conventions as for entities <!--(see ?)-->. However, a service cannot have (persisted) properties, nor can it have (persisted) collections.</p>
+<p>Services consist of a set of logically grouped actions, and as such follow the same conventions as for entities. However, a service cannot have (persisted) properties, nor can it have (persisted) collections.</p>
 
-<p>For convenience you can inherit from <code>AbstractService</code> or one of its subclasses <!--(see ?)-->, but this is not mandatory.</p>
+<p>For convenience you can <a href="../how-tos/how-to-01-010-How-to-have-a-domain-object-be-a-POJO.html">inherit</a> from <code>AbstractService</code> or one of its subclasses, but this is not mandatory.</p>
 
-<h3>The getId() method</h3>
+<h3>Registering domain services</h3>
 
-<p>Optionally, a service may provide a <code>getId()</code> method:</p>
+<p>All noted <a href="../how-to-09-010-How-to-register-domain-services,-repositories-and-factories.html">elsewhere</a>, domain services (which includes repositories and factories) should be registered in the <code>isis.properties</code> configuration file, under <code>isis.services</code> key (a comma-separated list):</p>
 
-<pre><code>public String getId()
+<p>For example:</p>
+
+<pre><code>isis.services = com.mycompany.myapp.employee.Employees\,
+                com.mycompany.myapp.claim.Claims\,
+                ...
 </code></pre>
 
-<p>This method returns a logical identifier for a service, independent of its implementation. Currently it used only by perspectives, providing a label by which to record the services that are available for a current user's profile. <!--See ? for more about profiles and perspectives.--></p>
+<p>This will then result in the framework instantiating a single instance of each of the services listed.</p>
+
+<p>If all services reside under a common package, then the <code>isis.services.prefix</code> can specify this prefix:</p>
+
+<pre><code>isis.services.prefix = com.mycompany.myapp
+isis.services = employee.Employees,\
+                claim.Claims,\
+                ...
+</code></pre>
+
+<p>This is quite rare, however; you will often want to use default implementations of domain services that are provided by the framework and so will not reside under this prefix.</p>
+
+<p>Examples of framework-provided services (as defined in the applib) can be found referenced from the main <a href="../../documentation.html">documentation</a> page.   They include clock, auditing, publishing, exception handling, view model support, snapshots/mementos, and user/application settings management.</p>
+
+<h3>Service scopes</h3>
+
+<p>By default all domain services are considered to be singletons, and thread-safe.</p>
+
+<p>Sometimes though a service's lifetime is applicable only to a single request; in other words it is request-scoped.</p>
+
+<p>The CDI annotation <code>@javax.enterprise.context.RequestScoped</code> is used to indicate this fact:</p>
+
+<pre><code> @javax.enterprise.context.RequestScoped
+ public class MyService extends AbstractService {
+     ...
+ }
+</code></pre>
+
+<p>The framework provides a number of request-scoped services; these can be found referenced from the main <a href="../../documentation.html">documentation</a> page.   They include scratchpad service, query results caching, and support for co-ordinating bulk actions. </p>
 
 <h3>(Suppressing) contributed actions</h3>
 
@@ -366,6 +398,15 @@ public interface EmailService {
 }
 </code></pre>
 
+<h3>The getId() method</h3>
+
+<p>Optionally, a service may provide a <code>getId()</code> method:</p>
+
+<pre><code>public String getId()
+</code></pre>
+
+<p>This method returns a logical identifier for a service, independent of its implementation. Currently it used only by perspectives, providing a label by which to record the services that are available for a current user's profile. <!--See ? for more about profiles and perspectives.--></p>
+
 
 
       </div>

Modified: websites/staging/isis/trunk/content/applib-guide/how-tos/how-to-01-010-How-to-have-a-domain-object-be-a-POJO.html
==============================================================================
--- websites/staging/isis/trunk/content/applib-guide/how-tos/how-to-01-010-How-to-have-a-domain-object-be-a-POJO.html (original)
+++ websites/staging/isis/trunk/content/applib-guide/how-tos/how-to-01-010-How-to-have-a-domain-object-be-a-POJO.html Sun Jan 19 15:38:13 2014
@@ -277,7 +277,7 @@
 </h1>
 </div>
 
-<h2>Pojos vs framework superclasses</h2>
+<h2>Pojos vs Inheriting from framework superclasses</h2>
 
 <p>It isn't mandatory for either domain entities or domain services to inherit from any framework superclass; they can be plain old java objects (pojos) if required.</p>
 

Modified: websites/staging/isis/trunk/content/documentation.html
==============================================================================
--- websites/staging/isis/trunk/content/documentation.html (original)
+++ websites/staging/isis/trunk/content/documentation.html Sun Jan 19 15:38:13 2014
@@ -345,7 +345,7 @@
 <h3>Pojos</h3>
 
 <ul>
-<li><a href="./applib-guide/how-tos/how-to-01-010-How-to-have-a-domain-object-be-a-POJO.html">Pojo vs framework abstract classe</a></li>
+<li><a href="./applib-guide/how-tos/how-to-01-010-How-to-have-a-domain-object-be-a-POJO.html">Pojo vs Inheriting from framework</a></li>
 <li><a href="./applib-guide/domain-services/how-to-09-010-How-to-register-domain-services,-repositories-and-factories.html">Registering a domain service</a></li>
 <li><a href="./applib-guide/how-tos/how-to-01-030-How-to-add-a-property-to-a-domain-entity.html">Entity property</a></li>
 <li><a href="./applib-guide/value-types/010-Built-in-Value-Types.html">Built-in Value Types</a></li>
@@ -452,7 +452,7 @@
 <h3>Idioms and patterns</h3>
 
 <ul>
-<li><a href="./applib-guide/domain-services/how-to-09-020-How-to-write-a-typical-domain-service.html">A typical domain service</a></li>
+<li><a href="./applib-guide/domain-services/how-to-09-020-How-to-write-a-typical-domain-service.html">Singleton &amp; request-scoped services</a></li>
 <li><a href="how-to-01-062-How-to-decouple-dependencies-using-contributions.html">Decoupling dependencies using contributions</a></li>
 <li><a href="./applib-guide/how-tos/how-to-01-065-How-to-add-an-action-to-be-called-on-every-object-in-a-list.html">Bulk actions, acting upon lists</a></li>
 <li><a href="./applib-guide/how-tos/how-to-04-060-How-to-set-up-and-maintain-bidirectional-relationships.html">Bidirectional relationships</a></li>