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/02/10 23:44:41 UTC

svn commit: r897226 - in /websites/staging/isis/trunk: cgi-bin/ content/ content/how-tos/ content/how-tos2/

Author: buildbot
Date: Mon Feb 10 22:44:41 2014
New Revision: 897226

Log:
Staging update by buildbot for isis

Added:
    websites/staging/isis/trunk/content/how-tos/how-to-09-040-How-to-write-a-custom-repository.html
    websites/staging/isis/trunk/content/how-tos/how-to-09-050-How-to-use-Factories.html
Removed:
    websites/staging/isis/trunk/content/how-tos2/how-to-09-040-How-to-write-a-custom-repository.html
    websites/staging/isis/trunk/content/how-tos2/how-to-09-050-How-to-use-Factories.html
Modified:
    websites/staging/isis/trunk/cgi-bin/   (props changed)
    websites/staging/isis/trunk/content/   (props changed)
    websites/staging/isis/trunk/content/documentation.html

Propchange: websites/staging/isis/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Feb 10 22:44:41 2014
@@ -1 +1 @@
-1566778
+1566781

Propchange: websites/staging/isis/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Feb 10 22:44:41 2014
@@ -1 +1 @@
-1566778
+1566781

Modified: websites/staging/isis/trunk/content/documentation.html
==============================================================================
--- websites/staging/isis/trunk/content/documentation.html (original)
+++ websites/staging/isis/trunk/content/documentation.html Mon Feb 10 22:44:41 2014
@@ -292,7 +292,7 @@
 <h4>Getting started</h4>
 
 <ul>
-<li><strong><a href="intro/getting-started/simple-archetype.html">Simple Archetype</a> (<a href="intro/getting-started/release-notes/about.html">1.3.1</a>)</strong>
+<li><strong><a href="intro/getting-started/simple-archetype.html">Simple Archetype</a> (<a href="archetypes/release-notes/about.html">1.3.1</a>)</strong>
 </div>
 <div class="col-md-4"></p>
 
@@ -339,7 +339,6 @@
 <li><a href="./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="./how-tos/how-to-09-010-How-to-register-domain-services,-repositories-and-factories.html">Registering a domain service</a></li>
 <li><a href="./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>
 <li><a href="./how-tos/how-to-01-040-How-to-specify-a-title-for-a-domain-entity.html">Entity title</a></li>
 <li><a href="./how-tos/how-to-01-050-How-to-add-a-collection-to-a-domain-entity.html">Entity collection</a></li>
 <li><a href="./how-tos/how-to-01-060-How-to-add-an-action-to-a-domain-entity-or-service.html">Entity or service action</a></li>
@@ -472,7 +471,6 @@
 <h4>Domain services</h4>
 
 <ul>
-<li><a href="./how-tos2/how-to-09-040-How-to-write-a-custom-repository.html">Custom repository</a></li>
 <li><a href="./how-tos2/how-to-09-050-How-to-use-Factories.html">Factories</a>
 </div>
 <div class="col-md-4"></li>

Added: websites/staging/isis/trunk/content/how-tos/how-to-09-040-How-to-write-a-custom-repository.html
==============================================================================
--- websites/staging/isis/trunk/content/how-tos/how-to-09-040-How-to-write-a-custom-repository.html (added)
+++ websites/staging/isis/trunk/content/how-tos/how-to-09-040-How-to-write-a-custom-repository.html Mon Feb 10 22:44:41 2014
@@ -0,0 +1,464 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+
+    <meta charset="utf-8">
+      <title></title>
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    
+    <!-- Le styles -->
+    <link href="./../bootstrap-3.0.0/css/bootstrap.css" rel="stylesheet">
+    <link href="./../prettify.css" rel="stylesheet">
+
+    <style type="text/css">
+        body {
+          padding-top: 60px;
+        }
+        .sprite {
+            display: inline-block;
+            height: 20px;
+            margin: 0 auto 4px;
+            outline: medium none;
+            text-indent: -999em;
+            width: 24px;
+            background-image: url('./../images/sprites.png');
+            background-repeat: no-repeat;
+            overflow: hidden;
+            cursor: pointer;
+        }
+        .edit-page {
+            display: inline-block;
+            height: 20px;
+            margin: 0 auto 4px;
+            outline: medium none;
+            text-indent: -999em;
+            width: 24px;
+            background-image: url('./../images/edit.png');
+            background-repeat: no-repeat;
+            overflow: hidden;
+            cursor: pointer;
+        }
+        .fb-share {
+            background-position: 0px -40px;
+        }
+        .gp-share {
+            background-position: 0px 0px;
+        }
+        .tw-share {
+            background-position: 0px -80px;
+        }
+        .markdown-content {
+            min-height: 500px;
+        }
+        .book-image img {
+          border: 1px;
+          border-style: solid;
+        }
+        .release-matrix .heading {
+            background-color: #eeeeee;
+        }
+        .release-matrix .new {
+            color: #dd0000;
+            font-weight: bolder;
+        }
+        .stub,.note {
+            position: relative;
+            padding: 7px 15px;
+            margin-bottom: 18px;
+            color: #404040;
+            background-color: #eedc94;
+            background-repeat: repeat-x;
+            background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94));
+            background-image: -moz-linear-gradient(top, #fceec1, #eedc94);
+            background-image: -ms-linear-gradient(top, #fceec1, #eedc94);
+            background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94));
+            background-image: -webkit-linear-gradient(top, #fceec1, #eedc94);
+            background-image: -o-linear-gradient(top, #fceec1, #eedc94);
+            background-image: linear-gradient(top, #fceec1, #eedc94);
+            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0);
+            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+            border-color: #eedc94 #eedc94 #e4c652;
+            border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
+            border-width: 1px;
+            border-style: solid;
+            -webkit-border-radius: 4px;
+            -moz-border-radius: 4px;
+            border-radius: 4px;
+            -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+            -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+        }
+        
+        div.XXXisis-tweak form {
+            margin-top: 6px;
+            margin-bottom: -2px;
+        }
+        
+        div.row div.col-md-12 {
+          border-top: 1px solid #eeeeee;
+        }
+        
+        
+        /* Isis specific stuff */
+
+        .container {
+          width: 940px;
+        }
+
+        .markdown-content .documentation .span-one-third p {
+          margin-bottom: 0px;
+        }
+
+        .markdown-content .documentation .group {
+          margin-top: 9px;
+        }
+
+        .documentation .group h2 {
+          border-bottom: 1px solid #DDD
+        }
+        .documentation h2 a, .documentation h3 a {
+          /* same as code style */
+          padding: 0 3px 2px;
+          font-family: Monaco, Andale Mono, Courier New, monospace;
+          font-size: 12px;
+          -webkit-border-radius: 3px;
+          -moz-border-radius: 3px;
+          border-radius: 3px;
+          padding: 1px 3px;
+        }
+        
+        .carousel-indicators li {
+          border: 1px solid rgb(192,70,1);
+        }
+
+        .carousel-indicators li.active {
+          background-color: rgb(192,70,1);
+        }
+        
+        .carousel-control .icon-prev,
+        .carousel-control .icon-next {
+          color: rgb(192,70,1);
+          font-size: 60px;
+        }
+        
+        .page-header {
+          margin-top: 0px;
+        }
+        
+    </style>
+    <script type="text/javascript">
+      function fbshare () {
+          window.open(
+                  "http://www.facebook.com/sharer/sharer.php?u="+document.URL,
+                  'Share on Facebook',
+                  'width=640,height=426');
+      };
+      function gpshare () {
+          window.open(
+                  "https://plus.google.com/share?url="+document.URL,
+                  'Share on Google+',
+                  'width=584,height=385');
+      };
+      function twshare () {
+          window.open(
+                  "https://twitter.com/intent/tweet?url="+document.URL+"&text=",
+                  'Share on Twitter',
+                  'width=800,height=526');
+      };
+    </script>
+
+    <!-- Le fav and touch icons -->
+    <link rel="shortcut icon" href="./../images/favicon.ico">
+
+    <script src="./../javascript/prettify.js" type="text/javascript"></script>
+    
+    <script src="//code.jquery.com/jquery.js"></script>
+    <script src="./../javascript/prettyprint.js"></script>
+    <script src="./../bootstrap-3.0.0/js/bootstrap.js"></script>
+
+
+    <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
+    <!--
+    <DISABLEDscript src="./../javascript/common.js"></DISABLEDscript>
+    -->
+
+    
+    
+    
+
+    <script>
+    $(function () { prettyPrint() })
+    $().dropdown()
+    </script>
+
+  </head>
+
+  <body>
+
+    <nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
+      <div class="container">
+        <a class="navbar-brand" href="./../index.html">Apache Isis&trade;</a>
+        <ul class="nav navbar-nav">
+          <li><a href="./../download.html">Download</a></li>
+          <li><a href="./../documentation.html">Documentation</a></li>
+          <li class="dropdown">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Screenshots<b class="caret"></b></a>
+            <ul class="dropdown-menu">
+              <li><a href="./../getting-started/screenshots.html">Screenshots</a></li>
+              <li><a href="./../getting-started/screencasts.html">Screencasts</a></li>
+              <li><a href="./../getting-started/powered-by.html">Powered by</a></li>
+              <li><a href="http://isisdemo.mmyco.co.uk/">Online Demo</a></li>
+            </ul>
+          </li>
+
+          <li class="dropdown">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Support<b class="caret"></b></a>
+            <ul class="dropdown-menu">
+              <li><a href="./../support.html">Mailing Lists</a></li>
+              <li><a href="http://isis.markmail.org/search/?q=">ML Archives</a></li>
+              <li><a href="https://issues.apache.org/jira/browse/ISIS">JIRA</a></li>
+              <li><a href="http://stackoverflow.com/questions/tagged/isis">Stack Overflow</a></li>
+              <li><a href="http://github.com/apache/isis">Github mirror</a></li>
+            </ul>
+          </li>
+
+          <FORM class="navbar-form navbar-right" id="searchbox_012614087480249044419:dn-q5gtwxya" action="http://www.google.com/cse">
+            <div class="form-group">
+              <input type="hidden" name="cx" value="012614087480249044419:dn-q5gtwxya">
+              <INPUT type="hidden" name="cof" value="FORID:0">
+              <INPUT class="form-control" name="q" type="text" placeholder="Search">
+            </div>
+          </FORM>
+          
+          <li class="dropdown  navbar-right">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache <b class="caret"></b></a>
+            <ul class="dropdown-menu">
+              <li>
+                <a href="http://www.apache.org/">Apache Homepage <i class="icon-share-alt"></i></a>
+              </li>
+              <li>
+                <a href="http://www.apache.org/licenses/">Licenses <i class="icon-share-alt"></i></a>
+              </li>
+              <li>
+                <a href="http://www.apache.org/security/">Security <i class="icon-share-alt"></i></a>
+              </li>
+              <li>
+                <a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship <i class="icon-share-alt"></i></a>
+              </li>
+              <li>
+                <a href="http://www.apache.org/foundation/thanks.html">Thanks <i class="icon-share-alt"></i></a>
+              </li>
+              <li>
+                <a href="./../more-thanks.html">More thanks <i class="icon-share-alt"></i></a>
+              </li>
+            </ul>
+          </li>
+        </ul>
+
+      </div>
+    </nav>
+
+    <div class="container">
+      <div class="markdown-content">
+      
+
+<div class="page-header">
+<p><a href="./../documentation.html">Docs</a>&nbsp;&raquo&nbsp;<a href="./../how-tos/about.html">How Tos</a></p>
+<h1>
+
+</h1>
+</div>
+
+<h2>How to write a custom repository</h2>
+
+<p>Repositories are defined as interfaces within the domain, and their implementation will vary by object store. During prototyping and for much of development, you will probably find it easiest to use an in-memory object store or perhaps the XML object store, with only a small number of instances. The <code>DomainObjectContainer</code> provides a set of methods that make it easy to pull back all instances from the object store which can then be filtered as required. Later on, you can replace
+the implementation depending upon the specifics of the object store that you'll be using for production.</p>
+
+<p>If you inherit from the 
+<code>org.apache.isis.applib.AbstractFactoryAndRepository</code> adapter class then this will automatically have the <code>DomainObjectContainer</code> injected, and
+provides convenience methods that delegate to the container. Using this is not mandatory, however.</p>
+
+<p>The methods provided by the <code>DomainObjectContainer</code> to support
+repositories are:</p>
+
+<ul>
+<li><code>allInstances(Class&lt;T&gt; ofType)</code></p>
+
+<p>Returns all instances of the specified type. Note that this includes
+all instances of any subtypes.</li>
+<li><code>allMatches(...)</code></p>
+
+<p>Returns all instances matching the provided arguments.</li>
+<li><code>firstMatch(...)</code></p>
+
+<p>Returns the first instance matching the provided arguments.</li>
+<li><code>uniqueMatch(...)</code></p>
+
+<p>Returns the one-and-only instance matching the provided arguments (else is an exception).</li>
+</ul>
+
+<p>The last three methods, <code>*Match(...)</code> are all overloaded in order to return a subset of object instances. Some of these are "naive"; all instances are returned from the object store, and the filtering is performed within the repository. Others are designed to pass the query predicate back to the object store so that only the matching rows are returned.</p>
+
+<p>Each of these options are discussed in more detail below.</p>
+
+<h3>Finding by Title</h3>
+
+<p>The first version of finding instances is to specify the required title for the matching objects:</p>
+
+<ul>
+<li><code>allMatches(Class&lt;T&gt; ofType, String title)</code></li>
+<li><code>firstMatch(Class&lt;T&gt; ofType, String title)</code></li>
+<li><code>uniqueMatch(Class&lt;T&gt; ofType, String title)</code></li>
+</ul>
+
+<p>Although easy and intuitive, this isn't generally recommended for production use because (a) the matching is performed within the repository rather than the object store, and (b) the title string can often change as business requirements are refined.</p>
+
+<p>That said, it is possible to eliminate the first disadvantage by using the Query API, discussed below; this provides an implementation that is equivalent to find by title.</p>
+
+<h3>Finding by Pattern</h3>
+
+<p>The next technique of finding instances is to specify pattern object to match against (sometimes called "query-by-example", or QBE):</p>
+
+<ul>
+<li><code>allMatches(Class&lt;T&gt; ofType, Object pattern)</code></li>
+<li><code>firstMatch(Class&lt;T&gt; ofType, Object pattern)</code></li>
+<li><code>uniqueMatch(Class&lt;T&gt; ofType, Object pattern)</code></li>
+</ul>
+
+<p>Any non-null value of the pattern object is used as the predicate.</p>
+
+<p>Although more robust that searching by title, this technique is also not likely to be valid for production code because the matching is still performed within the repository rather than within the object store.</p>
+
+<p>That said, it is possible to eliminate the first disadvantage by using the <code>Query</code> API, discussed below; this provides an implementation that is equivalent to find by pattern.</p>
+
+<blockquote>
+  <p><strong>Note</strong></p>
+  
+  <p>If the pattern object is created using <code>newTransientInstance(...)</code>, then
+  any default values for properties will automatically be set <!--(see ?)-->.
+  If this isn't required, they will need to be manually cleared.</p>
+</blockquote>
+
+<h3>Finding using the Filter API</h3>
+
+<p>The third overloaded version of the matching methods to find instances
+<code>all take an org.apache.isis.applib.Filter&lt;T&gt;</code> instance:</p>
+
+<ul>
+<li><code>allMatches(Class&lt;T&gt; ofType, Filter&lt;T&gt; filter)</code></li>
+<li><code>firstMatch(Class&lt;T&gt; ofType, Filter&lt;T&gt; filter)</code></li>
+<li><code>uniqueMatch(Class&lt;T&gt; ofType, Filter&lt;T&gt; filter)</code></li>
+</ul>
+
+<p>The <code>Filter&lt;T&gt;</code> interface is very straightforward:</p>
+
+<pre><code>public interface Filter&lt;T&gt; {
+    public boolean accept(T obj);
+}
+</code></pre>
+
+<p>Every object of the given type (and subclasses) is passed into the Filter instance; only those <code>accept()</code>'ed are returned from the <code>*Match()</code> method.</p>
+
+<p>Although flexible, with this technique the matching is also performed within the repository rather than the object store, and so is also likely not to be suitable for production use where there are many instances of the given type.</p>
+
+<h3>Finding using the Query API</h3>
+
+<p>The final overloaded version of the matching methods take an instance
+of <code>org.apache.isis.applib.query.Query&lt;T&gt;</code> interface:</p>
+
+<ul>
+<li><code>allMatches(Query&lt;T&gt; query)</code></li>
+<li><code>firstMatch(Query&lt;T&gt; query)</code></li>
+<li><code>uniqueMatch(Query&lt;T&gt; query)</code></li>
+</ul>
+
+<p>Unlike all the other matching mechanisms, the point of the <code>Query</code> interface is for it to be passed back to the object store and evaluated there.</p>
+
+<p>The applib provides several implementations that implement the
+<code>Query&lt;T&gt;</code> interface. Probably the most important of these is
+<code>QueryDefault&lt;T&gt;</code>, which provides a set of factory methods for
+constructing <code>Query</code> instances that represent a named query with a map of parameter/argument pairs.</p>
+
+<p>For example:</p>
+
+<pre><code>public class CustomerRepositoryImpl implements CustomerRepository {
+    public List&lt;Customer&gt; findCustomers(
+            @Named("Last Name") String lastName,
+            @Named("Postcode")  String postCode
+        ) {
+        QueryDefault&lt;Customer&gt; query = 
+            QueryDefault.create(
+                Customer.class, 
+                "findCustomers", 
+                "lastName", lastName, 
+                "postCode", postCode);
+
+        return getContainer().allMatches(query);
+    }
+    ...
+}
+</code></pre>
+
+<p>Above it was noted that the other overloaded versions of the matching API have the disadvantage that the matching is performed within the repository. As an alternative to using "find by title" or "find by pattern", you may wish to use <code>QueryFindByTitle</code> and <code>QueryFindByPattern</code>:</p>
+
+<ul>
+<li><code>QueryFindByTitle&lt;T&gt;</code>, which corresponds to the <code>allMatches(...)</code> for searching by title</li>
+<li><code>QueryFindByPattern&lt;T&gt;, which corresponds to the</code>allMatches(...)` for searching by pattern</li>
+</ul>
+
+<p>There is also a <code>QueryFindAllInstances&lt;T&gt;</code>, which corresponds to the
+<code>allInstances()</code> method.</p>
+
+<p>The interpretation of a <code>Query</code> instance ultimately depends on the object store. All object stores will support <code>QueryFindAllInstances</code>, and most will provide a mechanism to support <code>QueryDefault</code>. Check the object store documentation to determine whether they support other <code>Query</code> implementations (ie, <code>QueryFindByTitle</code> and <code>QueryFindByPattern</code>).</p>
+
+
+
+      </div>
+
+        <div id="edit" class="modal hide fade in" style="xxxdisplay: none; ">
+            <div class="modal-header">
+                <a class="close" data-dismiss="modal">x</a>
+
+                <h3>Thank you for contributing to the documention!</h3>
+            </div>
+            <div class="modal-body">
+                <h4>Any help with the documentation is greatly appreciated.</h4>
+                <p>All edits are reviewed before going live, so feel free to do much more than fix typos or links.  If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it.  Don't be surprised if we like it so much we ask you for help with other pages :)</p>
+                <small>NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.</small>
+                <!--[if gt IE 6]>
+                <h4>Internet Explorer Users</h4>
+                <p>If you are not an Apache committer, click the Yes link and enter a <i>anonymous</i> for the username and leave the password empty</p>
+                <![endif]-->
+
+            </div>
+            <div class="modal-footer">
+                Do you have an Apache ID?
+                <a href="javascript:void(location.href='https://cms.apache.org/redirect?uri='+escape(location.href))" class="btn">Yes</a>
+                <a href="javascript:void(location.href='https://anonymous:@cms.apache.org/redirect?uri='+escape(location.href))" class="btn">No</a>
+            </div>
+        </div>
+        <!--
+        <script src="./../javascript/bootstrap-modal.js"></script>
+        -->
+
+      <footer>
+        <hr/>
+        <p>
+        Copyright &copy; 2010~2014 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
+        <br/>
+        Apache Isis, Isis, Apache, the Apache feather logo, and the Apache Isis project logo are trademarks of The Apache Software Foundation.
+        </p>
+      </footer>
+
+    </div> <!-- /container -->
+
+  </body>
+</html>

Added: websites/staging/isis/trunk/content/how-tos/how-to-09-050-How-to-use-Factories.html
==============================================================================
--- websites/staging/isis/trunk/content/how-tos/how-to-09-050-How-to-use-Factories.html (added)
+++ websites/staging/isis/trunk/content/how-tos/how-to-09-050-How-to-use-Factories.html Mon Feb 10 22:44:41 2014
@@ -0,0 +1,341 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+
+    <meta charset="utf-8">
+      <title></title>
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    
+    <!-- Le styles -->
+    <link href="./../bootstrap-3.0.0/css/bootstrap.css" rel="stylesheet">
+    <link href="./../prettify.css" rel="stylesheet">
+
+    <style type="text/css">
+        body {
+          padding-top: 60px;
+        }
+        .sprite {
+            display: inline-block;
+            height: 20px;
+            margin: 0 auto 4px;
+            outline: medium none;
+            text-indent: -999em;
+            width: 24px;
+            background-image: url('./../images/sprites.png');
+            background-repeat: no-repeat;
+            overflow: hidden;
+            cursor: pointer;
+        }
+        .edit-page {
+            display: inline-block;
+            height: 20px;
+            margin: 0 auto 4px;
+            outline: medium none;
+            text-indent: -999em;
+            width: 24px;
+            background-image: url('./../images/edit.png');
+            background-repeat: no-repeat;
+            overflow: hidden;
+            cursor: pointer;
+        }
+        .fb-share {
+            background-position: 0px -40px;
+        }
+        .gp-share {
+            background-position: 0px 0px;
+        }
+        .tw-share {
+            background-position: 0px -80px;
+        }
+        .markdown-content {
+            min-height: 500px;
+        }
+        .book-image img {
+          border: 1px;
+          border-style: solid;
+        }
+        .release-matrix .heading {
+            background-color: #eeeeee;
+        }
+        .release-matrix .new {
+            color: #dd0000;
+            font-weight: bolder;
+        }
+        .stub,.note {
+            position: relative;
+            padding: 7px 15px;
+            margin-bottom: 18px;
+            color: #404040;
+            background-color: #eedc94;
+            background-repeat: repeat-x;
+            background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94));
+            background-image: -moz-linear-gradient(top, #fceec1, #eedc94);
+            background-image: -ms-linear-gradient(top, #fceec1, #eedc94);
+            background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94));
+            background-image: -webkit-linear-gradient(top, #fceec1, #eedc94);
+            background-image: -o-linear-gradient(top, #fceec1, #eedc94);
+            background-image: linear-gradient(top, #fceec1, #eedc94);
+            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0);
+            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+            border-color: #eedc94 #eedc94 #e4c652;
+            border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
+            border-width: 1px;
+            border-style: solid;
+            -webkit-border-radius: 4px;
+            -moz-border-radius: 4px;
+            border-radius: 4px;
+            -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+            -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+        }
+        
+        div.XXXisis-tweak form {
+            margin-top: 6px;
+            margin-bottom: -2px;
+        }
+        
+        div.row div.col-md-12 {
+          border-top: 1px solid #eeeeee;
+        }
+        
+        
+        /* Isis specific stuff */
+
+        .container {
+          width: 940px;
+        }
+
+        .markdown-content .documentation .span-one-third p {
+          margin-bottom: 0px;
+        }
+
+        .markdown-content .documentation .group {
+          margin-top: 9px;
+        }
+
+        .documentation .group h2 {
+          border-bottom: 1px solid #DDD
+        }
+        .documentation h2 a, .documentation h3 a {
+          /* same as code style */
+          padding: 0 3px 2px;
+          font-family: Monaco, Andale Mono, Courier New, monospace;
+          font-size: 12px;
+          -webkit-border-radius: 3px;
+          -moz-border-radius: 3px;
+          border-radius: 3px;
+          padding: 1px 3px;
+        }
+        
+        .carousel-indicators li {
+          border: 1px solid rgb(192,70,1);
+        }
+
+        .carousel-indicators li.active {
+          background-color: rgb(192,70,1);
+        }
+        
+        .carousel-control .icon-prev,
+        .carousel-control .icon-next {
+          color: rgb(192,70,1);
+          font-size: 60px;
+        }
+        
+        .page-header {
+          margin-top: 0px;
+        }
+        
+    </style>
+    <script type="text/javascript">
+      function fbshare () {
+          window.open(
+                  "http://www.facebook.com/sharer/sharer.php?u="+document.URL,
+                  'Share on Facebook',
+                  'width=640,height=426');
+      };
+      function gpshare () {
+          window.open(
+                  "https://plus.google.com/share?url="+document.URL,
+                  'Share on Google+',
+                  'width=584,height=385');
+      };
+      function twshare () {
+          window.open(
+                  "https://twitter.com/intent/tweet?url="+document.URL+"&text=",
+                  'Share on Twitter',
+                  'width=800,height=526');
+      };
+    </script>
+
+    <!-- Le fav and touch icons -->
+    <link rel="shortcut icon" href="./../images/favicon.ico">
+
+    <script src="./../javascript/prettify.js" type="text/javascript"></script>
+    
+    <script src="//code.jquery.com/jquery.js"></script>
+    <script src="./../javascript/prettyprint.js"></script>
+    <script src="./../bootstrap-3.0.0/js/bootstrap.js"></script>
+
+
+    <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
+    <!--
+    <DISABLEDscript src="./../javascript/common.js"></DISABLEDscript>
+    -->
+
+    
+    
+    
+
+    <script>
+    $(function () { prettyPrint() })
+    $().dropdown()
+    </script>
+
+  </head>
+
+  <body>
+
+    <nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
+      <div class="container">
+        <a class="navbar-brand" href="./../index.html">Apache Isis&trade;</a>
+        <ul class="nav navbar-nav">
+          <li><a href="./../download.html">Download</a></li>
+          <li><a href="./../documentation.html">Documentation</a></li>
+          <li class="dropdown">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Screenshots<b class="caret"></b></a>
+            <ul class="dropdown-menu">
+              <li><a href="./../getting-started/screenshots.html">Screenshots</a></li>
+              <li><a href="./../getting-started/screencasts.html">Screencasts</a></li>
+              <li><a href="./../getting-started/powered-by.html">Powered by</a></li>
+              <li><a href="http://isisdemo.mmyco.co.uk/">Online Demo</a></li>
+            </ul>
+          </li>
+
+          <li class="dropdown">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Support<b class="caret"></b></a>
+            <ul class="dropdown-menu">
+              <li><a href="./../support.html">Mailing Lists</a></li>
+              <li><a href="http://isis.markmail.org/search/?q=">ML Archives</a></li>
+              <li><a href="https://issues.apache.org/jira/browse/ISIS">JIRA</a></li>
+              <li><a href="http://stackoverflow.com/questions/tagged/isis">Stack Overflow</a></li>
+              <li><a href="http://github.com/apache/isis">Github mirror</a></li>
+            </ul>
+          </li>
+
+          <FORM class="navbar-form navbar-right" id="searchbox_012614087480249044419:dn-q5gtwxya" action="http://www.google.com/cse">
+            <div class="form-group">
+              <input type="hidden" name="cx" value="012614087480249044419:dn-q5gtwxya">
+              <INPUT type="hidden" name="cof" value="FORID:0">
+              <INPUT class="form-control" name="q" type="text" placeholder="Search">
+            </div>
+          </FORM>
+          
+          <li class="dropdown  navbar-right">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache <b class="caret"></b></a>
+            <ul class="dropdown-menu">
+              <li>
+                <a href="http://www.apache.org/">Apache Homepage <i class="icon-share-alt"></i></a>
+              </li>
+              <li>
+                <a href="http://www.apache.org/licenses/">Licenses <i class="icon-share-alt"></i></a>
+              </li>
+              <li>
+                <a href="http://www.apache.org/security/">Security <i class="icon-share-alt"></i></a>
+              </li>
+              <li>
+                <a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship <i class="icon-share-alt"></i></a>
+              </li>
+              <li>
+                <a href="http://www.apache.org/foundation/thanks.html">Thanks <i class="icon-share-alt"></i></a>
+              </li>
+              <li>
+                <a href="./../more-thanks.html">More thanks <i class="icon-share-alt"></i></a>
+              </li>
+            </ul>
+          </li>
+        </ul>
+
+      </div>
+    </nav>
+
+    <div class="container">
+      <div class="markdown-content">
+      
+
+<div class="page-header">
+<p><a href="./../documentation.html">Docs</a>&nbsp;&raquo&nbsp;<a href="./../how-tos/about.html">How Tos</a></p>
+<h1>
+
+</h1>
+</div>
+
+<h2>How to use Factories</h2>
+
+<p>Like repositories, factories are defined by interface in the domain, decoupling the domain objects from their actual implementation.</p>
+
+<p>Unlike repositories, there is no particular need to change the implementation when moving from one object store to another, because in all cases the factory can simply delegate to its injected <code>DomainObjectContainer</code>.</p>
+
+<p>The methods for <code>DomainObjectContainer</code> that are relevant for a factory are:</p>
+
+<ul>
+<li><code>&lt;T&gt; T newTransientInstance(final Class&lt;T&gt; ofClass)</code></li>
+<li><code>&lt;T&gt; T newPersistentInstance(final Class&lt;T&gt; ofClass)</code></li>
+<li><code>persist(Object)</code></li>
+<li><code>persistIfNotAlready(Object)</code></li>
+</ul>
+
+<!--
+These are discussed in more detail in ?. See also ? for full coverage of
+the methods available in DomainObjectContainer.-->
+
+
+
+      </div>
+
+        <div id="edit" class="modal hide fade in" style="xxxdisplay: none; ">
+            <div class="modal-header">
+                <a class="close" data-dismiss="modal">x</a>
+
+                <h3>Thank you for contributing to the documention!</h3>
+            </div>
+            <div class="modal-body">
+                <h4>Any help with the documentation is greatly appreciated.</h4>
+                <p>All edits are reviewed before going live, so feel free to do much more than fix typos or links.  If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it.  Don't be surprised if we like it so much we ask you for help with other pages :)</p>
+                <small>NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.</small>
+                <!--[if gt IE 6]>
+                <h4>Internet Explorer Users</h4>
+                <p>If you are not an Apache committer, click the Yes link and enter a <i>anonymous</i> for the username and leave the password empty</p>
+                <![endif]-->
+
+            </div>
+            <div class="modal-footer">
+                Do you have an Apache ID?
+                <a href="javascript:void(location.href='https://cms.apache.org/redirect?uri='+escape(location.href))" class="btn">Yes</a>
+                <a href="javascript:void(location.href='https://anonymous:@cms.apache.org/redirect?uri='+escape(location.href))" class="btn">No</a>
+            </div>
+        </div>
+        <!--
+        <script src="./../javascript/bootstrap-modal.js"></script>
+        -->
+
+      <footer>
+        <hr/>
+        <p>
+        Copyright &copy; 2010~2014 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
+        <br/>
+        Apache Isis, Isis, Apache, the Apache feather logo, and the Apache Isis project logo are trademarks of The Apache Software Foundation.
+        </p>
+      </footer>
+
+    </div> <!-- /container -->
+
+  </body>
+</html>