You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2013/08/15 10:52:12 UTC

svn commit: r1514205 - in /isis/site/trunk/content/applib-guide/how-tos: about.md how-to-07-010-How-to-set-up-the-initial-value-of-a-property-programmatically.md how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.md

Author: danhaywood
Date: Thu Aug 15 08:52:11 2013
New Revision: 1514205

URL: http://svn.apache.org/r1514205
Log:
updates on defaultXxx and callback methods

Modified:
    isis/site/trunk/content/applib-guide/how-tos/about.md
    isis/site/trunk/content/applib-guide/how-tos/how-to-07-010-How-to-set-up-the-initial-value-of-a-property-programmatically.md
    isis/site/trunk/content/applib-guide/how-tos/how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.md

Modified: isis/site/trunk/content/applib-guide/how-tos/about.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/applib-guide/how-tos/about.md?rev=1514205&r1=1514204&r2=1514205&view=diff
==============================================================================
--- isis/site/trunk/content/applib-guide/how-tos/about.md (original)
+++ isis/site/trunk/content/applib-guide/how-tos/about.md Thu Aug 15 08:52:11 2013
@@ -190,6 +190,8 @@ get visibility into and influence this b
 
 * [How to perform dirty object tracking](./how-to-07-060-How-to-perform-dirty-object-tracking.html)
 
+* [How to hook into the object lifecycle using callbacks](./how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.html)
+
 
 ##How to handle security concerns
 

Modified: isis/site/trunk/content/applib-guide/how-tos/how-to-07-010-How-to-set-up-the-initial-value-of-a-property-programmatically.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/applib-guide/how-tos/how-to-07-010-How-to-set-up-the-initial-value-of-a-property-programmatically.md?rev=1514205&r1=1514204&r2=1514205&view=diff
==============================================================================
--- isis/site/trunk/content/applib-guide/how-tos/how-to-07-010-How-to-set-up-the-initial-value-of-a-property-programmatically.md (original)
+++ isis/site/trunk/content/applib-guide/how-tos/how-to-07-010-How-to-set-up-the-initial-value-of-a-property-programmatically.md Thu Aug 15 08:52:11 2013
@@ -29,6 +29,25 @@ Alternatively, the domain object may cho
 values in the `created()` lifecycle method <!--(see ?)-->. This is called after
 any `defaultXxx()` methods are called.
 
+
+An alternative to using the `defaultXxx()` supporting methods is to use the `created()` callback.  This is sometimes preferable because it centralizes all the default logic into a single location.
+
+For example:
+
+    public class Customer {
+
+        public void created() {
+            setRegistered(clockService.now());
+        }
+
+        private LocalDate registered;
+        public LocalDate getRegistered() { ... }
+        public void setRegistered(LocalDate registered) { ... }
+        ...
+    }
+
+For more details of callbacks, see [How to hook into the object lifecycle using callbacks](./how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.html). 
+
 ### Programmatically, by the creator
 
 Third, and perhaps most obviously, the creator of the object could

Modified: isis/site/trunk/content/applib-guide/how-tos/how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/applib-guide/how-tos/how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.md?rev=1514205&r1=1514204&r2=1514205&view=diff
==============================================================================
--- isis/site/trunk/content/applib-guide/how-tos/how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.md (original)
+++ isis/site/trunk/content/applib-guide/how-tos/how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.md Thu Aug 15 08:52:11 2013
@@ -57,3 +57,4 @@ They are:
     <td><tt>deleted()</tt> is also supported, but is deprecated</td>
 </tr>
 </table>
+