Author: danhaywood
Date: Wed Nov 19 04:12:10 2014
New Revision: 1640484
URL: http://svn.apache.org/r1640484
Log:
tutorial
Added:
isis/site/trunk/content/intro/tutorials/apacheconeu-2014.md
- copied, changed from r1640453,
isis/site/trunk/content/tutorials/apacheconeu-2014.md
Removed:
isis/site/trunk/content/tutorials/about.md
isis/site/trunk/content/tutorials/apacheconeu-2014.md
Modified:
isis/site/trunk/content/documentation.md
isis/site/trunk/content/intro/tutorials/tutorials.md
Modified: isis/site/trunk/content/documentation.md
URL:
http://svn.apache.org/viewvc/isis/site/trunk/content/documentation.md?rev=1640484&r1=1640483&r2=1640484&view=diff
==============================================================================
--- isis/site/trunk/content/documentation.md (original)
+++ isis/site/trunk/content/documentation.md Wed Nov 19 04:12:10 2014
@@ -37,6 +37,7 @@ Title: Documentation
- **[Screencasts](intro/tutorials/screencasts.html)** <a
href="intro/tutorials/screencasts.html"><img src="./images/tv_show-25.png"></a>
- [Tutorials](intro/tutorials/tutorials.html)
+- **[ApacheCon EU 2014](intro/tutorials/apacheconeu-2014.html)**
}
Copied: isis/site/trunk/content/intro/tutorials/apacheconeu-2014.md (from
r1640453, isis/site/trunk/content/tutorials/apacheconeu-2014.md)
URL:
http://svn.apache.org/viewvc/isis/site/trunk/content/intro/tutorials/apacheconeu-2014.md?p2=isis/site/trunk/content/intro/tutorials/apacheconeu-2014.md&p1=isis/site/trunk/content/tutorials/apacheconeu-2014.md&r1=1640453&r2=1640484&rev=1640484&view=diff
==============================================================================
--- isis/site/trunk/content/tutorials/apacheconeu-2014.md (original)
+++ isis/site/trunk/content/intro/tutorials/apacheconeu-2014.md Wed Nov 19
04:12:10 2014
@@ -182,6 +182,7 @@ Most business functionality is implement
* use
[@ActionSemantics](http://isis.apache.org/reference/recognized-annotations/ActionSemantics.html)
annotation to indicate the semantics of the action (safe/query-only,
idempotent or non-idempotent)
* annotate safe action as
[@Bookmarkable](http://isis.apache.org/reference/recognized-annotations/Bookmarkable.html)
* confirm is available from bookmark panel (top-left of Wicket UI)
+* optional: add an action to clone an object
## REST API
@@ -261,31 +262,44 @@ Returning back to references, Isis also
* optional: Use the
[@SortedBy](http://isis.apache.org/reference/recognized-annotations/SortedBy.html)
annotation to specify a different comparator than the natural ordering
-## Actions (ctd)
+## Actions and Collections
+
+The Wicket UI doesn't allow collections to be modified (added to/removed
from). However, we can easily write actions to accomplish the same. Moreover,
these actions can provide some additional business logic. For example: it
probably shouldn't be possible to add an object twice into a collection, so it
should not be presented in the list of choices/autoComplete; conversely, only
those objects in the collection should be offered as choices to be removed.
* Add domain actions to add/remove from the collection
* to create objects,
[inject](http://isis.apache.org/how-tos/how-to-01-150-How-to-inject-services-into-a-domain-entity-or-other-service.html)
associated domain service
* generally we recommend using the `@Inject` annotation with either
private or default visibility
- * the service itself use [DomainObjectContainer]()
-* optional: add an action to clone an object
+ * the service itself should use
[DomainObjectContainer](http://isis.apache.org/reference/DomainObjectContainer.html)
+* Use the
[@MemberOrder](http://isis.apache.org/reference/recognized-annotations/MemberOrder.html)
annotation to associate an action with a property or with a collection
+ * set the `name` attribute
## Clock Service
-* To ensure testability, remove any dependencies on system time (eg defaults
for date/time action parameters)
- * ie calls `LocalDate.now()`
- * instead, inject
[ClockService](http://isis.apache.org/reference/services/ClockService.html) and
delegate to it
+To ensure testability, there should be no dependencies on system time, for
example usage of `LocalDate.now()`. Instead the domain objects should delegate
to the provided `ClockService`.
+
+* remove any dependencies on system time (eg defaults for date/time action
parameters)
+ * inject
[ClockService](http://isis.apache.org/reference/services/ClockService.html)
+ * call `ClockService.now()` etc where required.
-## Layout
+## Dynamic Layout
-* Use the
[@MemberOrder](http://isis.apache.org/reference/recognized-annotations/MemberOrder.html)
annotation to associate an action with a property or with a collection
- * set the `name` attribute
-* Delete the `@MemberOrder` annotations and use the associated
[.layout.json](http://isis.apache.org/components/viewers/wicket/dynamic-layouts.html)
file to specify layout hints instead
+Up to this point we've been using annotations (`@MemberOrder`,
`@MemberGroupLayout`, `@Named` and so on) for UI hints. However, the feedback
loop is not good: it requires us stopping the app, editing the code,
recompiling and running again. So instead, all these UI hints (and more) can
be specified dynamically, using a corresponding `.layout.json` file. If edited
while the app is running, it will be reloaded automatically (in IntelliJ, use
Run>Reload Changed Classes):
+
+* Delete the `@MemberOrder` and `@MemberGroupLayout` annotations and instead
specify layout hints using a
[.layout.json](http://isis.apache.org/components/viewers/wicket/dynamic-layouts.html)
file.
## Business rules
+Apache Isis excels for domains where there are complex business rules to
enforce. The UI tries not to constrain the user from navigating around freely,
however the domain objects nevertheless ensure that they cannot change into an
invalid state. Such rules can be enforced either declaratively (using
annotations) or imperatively (using code). The objects can do this in one of
three ways:
+
+- visibility: preventing the user from even seeing a property/collection/action
+- usability: allowing the user to view a property/collection/action but not
allowing the user to change it
+- validity: allowing the user to modify the property/invoke the action, but
validating that the new value/action arguments are correct before hand.
+
+Or, more pithily: "see it, use it, do it"
+
### See it!
* Use the
[@Hidden](http://isis.apache.org/reference/recognized-annotations/Hidden.html)
annotation to make properties/collections/actions invisible
Modified: isis/site/trunk/content/intro/tutorials/tutorials.md
URL:
http://svn.apache.org/viewvc/isis/site/trunk/content/intro/tutorials/tutorials.md?rev=1640484&r1=1640483&r2=1640484&view=diff
==============================================================================
--- isis/site/trunk/content/intro/tutorials/tutorials.md (original)
+++ isis/site/trunk/content/intro/tutorials/tutorials.md Wed Nov 19 04:12:10
2014
@@ -1,5 +1,10 @@
Title: Tutorials
+## Stop Scaffolding, Start Coding
+
+This [tutorial](apacheconeu-2014.html) was originally put together for Apache
Con Europe 2014.
+
+
## RRRADDD!!! Really Ridiculously Rapid Application Development (Domain-Driven)
### 2012 edition
@@ -17,3 +22,4 @@ At [Oredev 2013](http://oredev.org/2013)
To support that presentation, there is a [github
project](https://github.com/danhaywood/rrraddd-isis-131), set up to run against
Isis v1.3.1. You can run throug the README of that project, or just do a `git
checkout` for each of the various tags (22 in all!)
+There's also an [updated
version](https://github.com/danhaywood/isis-tutorial-140) that runs against
Isis v1.4.0.
\ No newline at end of file