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 2015/10/16 19:29:30 UTC

isis git commit: ISIS-1213: updating docs for mixins. Also fix for parameter validation

Repository: isis
Updated Branches:
  refs/heads/master f41d831fd -> 342da9cfb


ISIS-1213: updating docs for mixins.  Also fix for parameter validation


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/342da9cf
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/342da9cf
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/342da9cf

Branch: refs/heads/master
Commit: 342da9cfb5e7cc193963f83d95cb0b5a6a0cb5b3
Parents: f41d831
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Oct 16 18:27:34 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Oct 16 18:27:34 2015 +0100

----------------------------------------------------------------------
 .../_rg_annotations_manpage-DomainObject.adoc   |   4 +-
 ...annotations_manpage-DomainObject_nature.adoc |   7 +
 .../guides/_rg_annotations_manpage-Mixin.adoc   |  40 ++++
 .../src/main/asciidoc/guides/_rg_classes.adoc   |   3 +-
 .../guides/_rg_classes_contributee.adoc         |  13 ++
 ...es_contributee_manpage-HasTransactionId.adoc |  31 +++
 ...classes_contributee_manpage-HasUserName.adoc |  27 +++
 .../asciidoc/guides/_rg_classes_mixins.adoc     |  13 --
 ...classes_mixins_manpage-HasTransactionId.adoc |  31 ---
 .../_rg_classes_mixins_manpage-HasUserName.adoc |  27 ---
 ...mainObjectContainer_object-creation-api.adoc |  13 +-
 .../main/asciidoc/guides/_rg_services-spi.adoc  |   4 +-
 .../_ug_core-concepts_building-blocks.adoc      |   2 +-
 .../_ug_core-concepts_philosophy_aop.adoc       |   2 +-
 .../guides/_ug_how-tos_domain-services.adoc     |   3 +-
 .../guides/_ug_more-advanced_decoupling.adoc    |   2 +
 ..._more-advanced_decoupling_contributions.adoc |  17 +-
 .../_ug_more-advanced_decoupling_mixins.adoc    | 191 +++++++++++++++++++
 ...esting_integ-test-support_bootstrapping.adoc |   2 +-
 .../specimpl/ObjectActionParameterAbstract.java |  22 +--
 .../OneToOneActionParameterContributee.java     |   4 +-
 .../OneToOneActionParameterMixedIn.java         |   6 +-
 ...ParameterAbstractTest_getId_and_getName.java |   2 +-
 23 files changed, 363 insertions(+), 103 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject.adoc
index a120242..49ffa46 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject.adoc
@@ -49,8 +49,8 @@ The table below summarizes the annotation's attributes.
 
 
 |xref:rg.adoc#_rg_annotations_manpage-DomainObject_nature[`nature()`]
-|`NOT_SPECIFIED`, `JDO_ENTITY`, `EXTERNAL_ENTITY`, `INMEMORY_ENTITY`, `VIEW_MODEL` (`NOT_SPECIFIED`)
-|whether the domain object logically is an entity (part of the domain layer) or is a view model (part of the application layer); and if an entity, how is its persistence managed
+|`NOT_SPECIFIED`, `JDO_ENTITY`, `EXTERNAL_ENTITY`, `INMEMORY_ENTITY`, `MIXIN`, `VIEW_MODEL` (`NOT_SPECIFIED`)
+|whether the domain object logically is an entity (part of the domain layer) or is a view model (part of the application layer); or is a mixin.  If an entity, indicates how its persistence is managed.
 
 
 |xref:rg.adoc#_rg_annotations_manpage-DomainObject_objectType[`objectType()`]

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_nature.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_nature.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_nature.adoc
index 061a3b1..250a92c 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_nature.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-DomainObject_nature.adoc
@@ -40,6 +40,13 @@ indicates that the domain object is a wrapper/proxy/stub to a "synthetic" entity
 +
 The identity of an inmemory entity is determined solely by the state of entity's properties.  The framework will automatically recreate the domain object each time it is interacted with.
 
+* `MIXIN` +
++
+(`1.10.0-SNAPSHOT`) indicates that the domain object is part of the domain layer, and is contributing behaviour to objects of some other type as a mixin (also known as a trait).
+
+Equivalent to annotating with xref:rg.adoc#_rg_annotations_manpage-Mixin[`@Mixin`].  For further discussion on using mixins, see xref:ug.adoc#_ug_more-advanced_decoupling_mixins[mixins] in the user guide.
+
+
 * `VIEW_MODEL` +
 +
 indicates that the domain object is conceptually part of the application layer, and exists to surfaces behaviour and/or state that is aggregate of one or more domain entities.

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Mixin.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Mixin.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Mixin.adoc
new file mode 100644
index 0000000..d10a7b1
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Mixin.adoc
@@ -0,0 +1,40 @@
+[[_rg_annotations_manpage-Mixin]]
+= `@Mixin`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+
+The `@Mixin` annotation (`1.10.0-SNAPSHOT`) indicates that the class acts as a mixin, contributing behaviour -
+actions, (derived) properties and (derived) collections - to another domain object.
+
+For example:
+
+[source,java]
+----
+@Mixin
+public class DocumentHolder_documents {
+    private final DocumentHolder holder;
+    public DocumentHolder_documents(DocumentHolder holder) {
+        this.holder = holder;
+    }
+    @Action(semantics=SemanticsOf.SAFE)
+    @ActionLayout(contributed = Contributed.AS_ASSOCIATION)
+    @CollectionLayout(render = RenderType.EAGERLY)
+    public List<Document> documents() {
+        ...                                                     // <1>
+    }
+}
+----
+<1> for example, using the (non-ASF) http://github.com/isisaddons/isis-module-poly[Isis addons' poly] module.
+
+
+An alternative and equivalent approach is to use the
+xref:rg.adoc#_rg_annotations_manpage-DomainObject_nature[`@DomainObject#nature()`] annotation with a nature of `MIXIN`.
+
+
+For further discussion on using mixins, see xref:ug.adoc#_ug_more-advanced_decoupling_mixins[mixins] in the user guide.
+
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_classes.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_classes.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_classes.adoc
index fddc8e8..528a8a3 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_classes.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_classes.adoc
@@ -14,6 +14,7 @@ include::_rg_classes_value-types.adoc[leveloffset=+1]
 include::_rg_classes_utility.adoc[leveloffset=+1]
 include::_rg_classes_spec.adoc[leveloffset=+1]
 include::_rg_classes_i18n.adoc[leveloffset=+1]
-include::_rg_classes_mixins.adoc[leveloffset=+1]
+include::_rg_classes_contributee.adoc[leveloffset=+1]
 include::_rg_classes_roles.adoc[leveloffset=+1]
 
+

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee.adoc
new file mode 100644
index 0000000..78d9c5a
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee.adoc
@@ -0,0 +1,13 @@
+[[_rg_classes_contributee]]
+= Contributee
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The interfaces listed in this chapter act as contributees; they allow domain services to contribute actions/properties/collections to any domain objects that implement these interfaces.
+
+
+include::_rg_classes_contributee_manpage-HasTransactionId.adoc[leveloffset=+1]
+include::_rg_classes_contributee_manpage-HasUserName.adoc[leveloffset=+1]
+

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee_manpage-HasTransactionId.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee_manpage-HasTransactionId.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee_manpage-HasTransactionId.adoc
new file mode 100644
index 0000000..c645745
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee_manpage-HasTransactionId.adoc
@@ -0,0 +1,31 @@
+[[_rg_classes_mixins_manpage-HasTransactionId]]
+= `HasTransactionId`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `HasTransactionId` interface is a mix-in for any domain objects that reference a transaction id, such as
+auditing entries or commands.
+
+The interface is defined is:
+
+[source,java]
+----
+public interface HasTransactionId {
+
+    public UUID getTransactionId();                             // <1>
+    public void setTransactionId(final UUID transactionId);
+}
+----
+<1> unique identifier (a GUID) of the transaction in which this interaction occurred.
+
+
+
+Modules that either have domain entity that implement and/or services that contribute this interface are:
+
+* (non-ASF) http://github.com/isisaddons/isis-module-audit[Isis addons' audit] module (`AuditEntry` entity, `AuditingServiceContributions` service)
+* (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module (`CommandJdo` entity, `CommandServiceJdoContributions` service)
+* (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module (`PublishedEvent` entity, `PublishingServiceContributions`)
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee_manpage-HasUserName.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee_manpage-HasUserName.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee_manpage-HasUserName.adoc
new file mode 100644
index 0000000..1618b5c
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_classes_contributee_manpage-HasUserName.adoc
@@ -0,0 +1,27 @@
+[[_rg_classes_mixins_manpage-HasUserName]]
+= `HasUsername`
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+The `HasUsername` interface is a mix-in for domain objects to be associated with a username.  Other services and modules can then contribute actions/collections to render such additional information relating to the activities of the user.
+
+The interface is defined is:
+
+[source,java]
+----
+public interface HasUsername {
+    public String getUsername();
+}
+----
+
+Modules that either have domain entity that implement and/or services that contribute this interface are:
+
+* (non-ASF) http://github.com/isisaddons/isis-module-security[Isis addons' security] module ( `ApplicationUser` entity, `HasUsernameContributions` service)
+* (non-ASF) http://github.com/isisaddons/isis-module-audit[Isis addons' audit] module (`AuditEntry` entity,
+* (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module's `CommandJdo` entity, `HasUsernameContributions` service)
+* (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module (`PublishedEvent` entity)
+* (non-ASF) http://github.com/isisaddons/isis-module-sessionlogger[Isis addons' sessionlogger] module (`SessionLogEntry` entity, `HasUsernameContributions` service)
+* (non-ASF) http://github.com/isisaddons/isis-module-settings[Isis addons' settings] module (`UserSettingJdo` entity)
+

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins.adoc
deleted file mode 100644
index a935ca8..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins.adoc
+++ /dev/null
@@ -1,13 +0,0 @@
-[[_rg_classes_mixins]]
-= Mixins
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The interfaces listed in this chapter act like "mix-ins"; they allow domain services to contribute actions/properties/collections to any domain objects that implement these interfaces.
-
-
-include::_rg_classes_mixins_manpage-HasTransactionId.adoc[leveloffset=+1]
-include::_rg_classes_mixins_manpage-HasUserName.adoc[leveloffset=+1]
-

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins_manpage-HasTransactionId.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins_manpage-HasTransactionId.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins_manpage-HasTransactionId.adoc
deleted file mode 100644
index c645745..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins_manpage-HasTransactionId.adoc
+++ /dev/null
@@ -1,31 +0,0 @@
-[[_rg_classes_mixins_manpage-HasTransactionId]]
-= `HasTransactionId`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `HasTransactionId` interface is a mix-in for any domain objects that reference a transaction id, such as
-auditing entries or commands.
-
-The interface is defined is:
-
-[source,java]
-----
-public interface HasTransactionId {
-
-    public UUID getTransactionId();                             // <1>
-    public void setTransactionId(final UUID transactionId);
-}
-----
-<1> unique identifier (a GUID) of the transaction in which this interaction occurred.
-
-
-
-Modules that either have domain entity that implement and/or services that contribute this interface are:
-
-* (non-ASF) http://github.com/isisaddons/isis-module-audit[Isis addons' audit] module (`AuditEntry` entity, `AuditingServiceContributions` service)
-* (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module (`CommandJdo` entity, `CommandServiceJdoContributions` service)
-* (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module (`PublishedEvent` entity, `PublishingServiceContributions`)
-
-

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins_manpage-HasUserName.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins_manpage-HasUserName.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins_manpage-HasUserName.adoc
deleted file mode 100644
index 1618b5c..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_classes_mixins_manpage-HasUserName.adoc
+++ /dev/null
@@ -1,27 +0,0 @@
-[[_rg_classes_mixins_manpage-HasUserName]]
-= `HasUsername`
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-:_basedir: ../
-:_imagesdir: images/
-
-
-The `HasUsername` interface is a mix-in for domain objects to be associated with a username.  Other services and modules can then contribute actions/collections to render such additional information relating to the activities of the user.
-
-The interface is defined is:
-
-[source,java]
-----
-public interface HasUsername {
-    public String getUsername();
-}
-----
-
-Modules that either have domain entity that implement and/or services that contribute this interface are:
-
-* (non-ASF) http://github.com/isisaddons/isis-module-security[Isis addons' security] module ( `ApplicationUser` entity, `HasUsernameContributions` service)
-* (non-ASF) http://github.com/isisaddons/isis-module-audit[Isis addons' audit] module (`AuditEntry` entity,
-* (non-ASF) http://github.com/isisaddons/isis-module-command[Isis addons' command] module's `CommandJdo` entity, `HasUsernameContributions` service)
-* (non-ASF) http://github.com/isisaddons/isis-module-publishing[Isis addons' publishing] module (`PublishedEvent` entity)
-* (non-ASF) http://github.com/isisaddons/isis-module-sessionlogger[Isis addons' sessionlogger] module (`SessionLogEntry` entity, `HasUsernameContributions` service)
-* (non-ASF) http://github.com/isisaddons/isis-module-settings[Isis addons' settings] module (`UserSettingJdo` entity)
-

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_services-api_manpage-DomainObjectContainer_object-creation-api.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_services-api_manpage-DomainObjectContainer_object-creation-api.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_services-api_manpage-DomainObjectContainer_object-creation-api.adoc
index 1c803fd..4301d70 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_services-api_manpage-DomainObjectContainer_object-creation-api.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_services-api_manpage-DomainObjectContainer_object-creation-api.adoc
@@ -15,11 +15,15 @@ public interface DomainObjectContainer {
     <T> T newTransientInstance(final Class<T> ofType);                              // <1>
     @Programmatic
     <T> T newViewModelInstance(final Class<T> ofType, final String memento);        // <2>
+    @Programmatic
+    <T> T mixin();                                                                  // <3>
     ...
 }
 ----
 <1> create a new non-persisted domain entity.  Any services will be automatically injected into the service
 <2> create a new view model, with the specified memento (as per xref:rg.adoc#_rg_classes_super_manpage-AbstractViewModel[ViewModel#viewModelMemento()].  In general it is easier to just annotate with xref:rg.adoc#_rg_annotations_manpage-ViewModel[`@ViewModel`] and let Apache Isis manage the memento automatically.
+<3> (`1.10.0-SNAPSHOT`) programmatically instantiate a mixin, as annotated with
+xref:rg.adoc#_rg_annotations_manpage-Mixin[`@Mixin`] or xref:rg.adoc#_rg_annotations_manpage-DomainObject_nature[`@DomainObject#nature()`].
 
 For example:
 
@@ -31,10 +35,15 @@ cust.setLastName("Mercury");
 container.persist(cust);
 ----
 
-As an alternative to using `newTransientInstance(...)`, you could also simply `new()` up the object.  Doing this will not inject any domain services, but they can be injected manually using xref:rg.adoc#_rg_services-api_manpage-DomainObjectContainer_services-api[#injectServicesInto(...)`].
+As an alternative to using `newTransientInstance(...)` or `mixin(...)`, you could also simply `new()` up the object.
+Doing this will not inject any domain services, but they can be injected manually using xref:rg .adoc#_rg_services-api_manpage-DomainObjectContainer_services-api[#injectServicesInto(...)`].
 
 [NOTE]
 ====
-Calling `new(...)` also this circumvents Apache Isis' xref:rg.adoc#_rg_methods_reserved_manpage-created[`created()`] callback, and in addition any default values for properties (either explicitly set by xref:rg.adoc#_rg_methods_prefixes_manpage-default[`default...()`] or defaulted implicitly according to Apache Isis' own conventions) will not be called either.  If you don't intend to use these features, though, the net effect is code that has less coupling to Isis and is arguably easier to understand (has "less magic" happening).
+Calling `new(...)` also this circumvents Apache Isis' xref:rg.adoc#_rg_methods_reserved_manpage-created[`created()`]
+callback, and in addition any default values for properties (either explicitly set by
+xref:rg.adoc#_rg_methods_prefixes_manpage-default[`default...()`] or defaulted implicitly according to Apache Isis'
+own conventions) will not be called either.  If you don't intend to use these features, though, the net effect is code
+that has less coupling to Isis and is arguably easier to understand (has "less magic" happening).
 ====
 

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_rg_services-spi.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_services-spi.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_services-spi.adoc
index 56c5da7..456cdec 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_services-spi.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_services-spi.adoc
@@ -142,9 +142,9 @@ a configured `EmailService`
 ``isis-module-publishing``
 |related services:
 `PublishingService-` ++
-`Contributions`,
+``Contributions``,
 `PublishingService-` ++
-`Repository`.  +
+``Repository``.  +
 depends on: +
 `EventSerializer`
 

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_ug_core-concepts_building-blocks.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ug_core-concepts_building-blocks.adoc b/adocs/documentation/src/main/asciidoc/guides/_ug_core-concepts_building-blocks.adoc
index 0860267..180ab7c 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ug_core-concepts_building-blocks.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ug_core-concepts_building-blocks.adoc
@@ -15,7 +15,7 @@ NOTE: TODO
 * layout hints are overridable, to avoid restarting the app/speed up feedback
 
 
-## Domain Objects and Domain Services
+## Objects & Services
 
 NOTE: TODO
 

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_ug_core-concepts_philosophy_aop.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ug_core-concepts_philosophy_aop.adoc b/adocs/documentation/src/main/asciidoc/guides/_ug_core-concepts_philosophy_aop.adoc
index f5e1cbb..b3b17b2 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ug_core-concepts_philosophy_aop.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ug_core-concepts_philosophy_aop.adoc
@@ -33,4 +33,4 @@ Apache Isis also has an internal event bus (you can switch between an underlying
 
 Finally, Isis also a feature that is akin to AOP mix-ins.  A "contributed action" is one that is implemented on a domain service but that appears to be a behaviour of rendered domain object.  In other words, we can dissociate behaviour from data.  That's not always the right thing to do of course.  In Richard Pawson's description of the xref:ug.adoc#_ug_core-concepts_philosophy_naked-objects-pattern[naked objects pattern] he talks about "behaviourally rich" objects, in other words where the business functionality encapsulated the data.   But on the other hand sometimes the behaviour and data structures change at different rates.  The link:http://en.wikipedia.org/wiki/Single_responsibility_principle[single responsibility principle] says we should only lump code together that changes at the same rate.  Apache Isis' support for contributions (not only contributed actions, but also contributed properties and contributed collections) enables this.  And again, to loop back to the topic of
  this section, it's an AOP concept that being implemented by the framework.
 
-The nice thing about aspect orientation is that for the most part you can ignore these cross-cutting concerns and - at least initially at least - just focus on implementing your domain object.  Later when your app starts to grow and you start to break it out into smaller modules, you can leverage Apache Isis' AOP support for mixins (xref:ug.adoc#_ug_more-advanced_decoupling_contributions[contributions]) and interceptors (the xref:ug.adoc#_ug_more-advanced_decoupling_event-bus[event bus]) to ensure that your codebase remains maintainable.
\ No newline at end of file
+The nice thing about aspect orientation is that for the most part you can ignore these cross-cutting concerns and - at least initially at least - just focus on implementing your domain object.  Later when your app starts to grow and you start to break it out into smaller modules, you can leverage Apache Isis' AOP support for (xref:ug.adoc#_ug_more-advanced_decoupling_mixins[mixins]), (xref:ug.adoc#_ug_more-advanced_decoupling_contributions[contributions]) and interceptors (the xref:ug.adoc#_ug_more-advanced_decoupling_event-bus[event bus]) to ensure that your codebase remains maintainable.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_ug_how-tos_domain-services.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ug_how-tos_domain-services.adoc b/adocs/documentation/src/main/asciidoc/guides/_ug_how-tos_domain-services.adoc
index bfc9e30..5a57149 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ug_how-tos_domain-services.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ug_how-tos_domain-services.adoc
@@ -172,7 +172,8 @@ public OrderContributions {
 <2> contributed as an association, in particular as a collection because returns a `List<T>`.
 <3> Only actions with a single argument can be contributed as associations
 
-More information about contributions can be found xref:ug.adoc#_ug_how-tos_contributed-members[here].
+More information about contributions can be found xref:ug.adoc#_ug_how-tos_contributed-members[here].  More information
+about using contributions and mixins to keep your domain application decoupled can be found xref:ug.adoc#_ug_more-advanced_decoupling_contributions[here] and xref:ug.adoc#_ug_more-advanced_decoupling_mixins[here].
 
 
 === Event Subscribers

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling.adoc b/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling.adoc
index 2bbc0a4..2cdda43 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling.adoc
@@ -4,6 +4,7 @@
 :_basedir: ../
 :_imagesdir: images/
 
+
 We use Java packages as a way to group related domain objects together; the package name forms a namespace. We can then
 reason about all the classes in that package/namespace as a single unit, or module.
 
@@ -17,6 +18,7 @@ There is some overlap with OSGi and Java 9's Jigsaw concepts of "module"; in the
 ====
 
 include::_ug_more-advanced_decoupling_db-schemas.adoc[leveloffset=+1]
+include::_ug_more-advanced_decoupling_mixins.adoc[leveloffset=+1]
 include::_ug_more-advanced_decoupling_contributions.adoc[leveloffset=+1]
 include::_ug_more-advanced_decoupling_vetoing-visibility.adoc[leveloffset=+1]
 include::_ug_more-advanced_decoupling_event-bus.adoc[leveloffset=+1]

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling_contributions.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling_contributions.adoc b/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling_contributions.adoc
index b2f4b81..ef7a341 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling_contributions.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling_contributions.adoc
@@ -4,5 +4,20 @@
 :_basedir: ../
 :_imagesdir: images/
 
-NOTE: TODO
+
+Contributed services provide many of the same benefits as xref:ug.adoc#_ug_more-advanced_decoupling_mixins[mixins];
+indeed mixins (`1.10.0-SNAPSHOT`) are an evolution and refinement of the contributions concept.
+
+The main difference between contributed services and mixins is that the actions of a contributed service will
+contribute to _all_ the parameters of its actions, whereas a mixin only contributes to the type accepted in its
+constructor.  Also, contributed services are long-lived
+singletons, whereas mixins are instantiated as required (by the framework) and then discarded almost immediately.
+
+For more on contributed services:
+
+* the syntax of writing contributed actions/properties/collections is described in this xref:ug.adoc#_ug_how-tos_contributed-members[how-to]
+
+* there's also useful information in the reference guide, discussing the xref:rg.adoc#_rg_annotations_manpage-DomainService_nature[@DomainService#nature()] attribute, for the `NatureOfService.VIEW_CONTRIBUTIONS_ONLY` nature.
+
+
 

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling_mixins.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling_mixins.adoc b/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling_mixins.adoc
new file mode 100644
index 0000000..c5fb367
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/_ug_more-advanced_decoupling_mixins.adoc
@@ -0,0 +1,191 @@
+[[_ug_more-advanced_decoupling_mixins]]
+= Mixins
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+:_basedir: ../
+:_imagesdir: images/
+
+
+A mixin object (`1.10.0-SNAPSHOT`) allows one class to contribute behaviour - actions, (derived) properties and
+(derived) collections - to another domain object, either a domain entity or view model.
+
+Some programming languages use the term "trait" instead of mixin, and some languages (such as AspectJ) define their own
+syntax for defining such constructs.  In Apache Isis a mixin is very similar to a domain service, however it also
+defines a single 1-arg constructor that defines the type of the domain objects that it contributes to.
+
+Why do this?  The main reason is to allow the app to be decoupled, so that it doesn't degrade into the proverbial
+link:http://www.laputan.org/mud/mud.html#BigBallOfMud["big ball of mud"].  Mixins (and contributions) allow dependency
+to be inverted, so that the dependencies between modules can be kept acyclic and under control.
+
+
+
+== Example
+
+This is probably best explained by way of an example.  Suppose we have the `Customer` domain object which implements
+a `DocumentHolder` interface:
+
+[source,java]
+----
+public class Customer implements DocumentHolder {
+    ...
+}
+----
+
+
+We could then imagine a mixin that would contribute behaviour to list, add and remove the ``Document``s for this holder:
+
+[source,java]
+----
+@Mixin                                                          // <1>
+public class DocumentHolder_documents {
+    private final DocumentHolder holder;
+    public DocumentHolder_documents(DocumentHolder holder) {    // <2>
+        this.holder = holder;
+    }
+    @Action(semantics=SemanticsOf.SAFE)
+    @ActionLayout(contributed = Contributed.AS_ASSOCIATION)
+    @CollectionLayout(render = RenderType.EAGERLY)
+    public List<Document> documents() {
+        ...                                                     // <3>
+    }
+    @Action(semantics=SemanticsOf.IDEMPOTENT)
+    public DocumentHolder add(Document document) {
+        ...                                                     // <4>
+    }
+    @Action(semantics=SemanticsOf.IDEMPOTENT)
+    public DocumentHolder remove(Document document) {
+        ...                                                     // <5>
+    }
+}
+----
+<1> alternatively can use `@DomainObject(nature=Nature.MIXIN)`
+<2> constructor indicates the type that is contributed to
+<3> implementation could, for example, use the (non-ASF)
+http://github.com/isisaddons/isis-module-poly[Isis addons' poly] module.
+<4> implementation would probably delegate to an injected repository to (ultimately) insert data into some table
+<5> implementation would probably delegate to an injected repository to (ultimately) delete data from some table
+
+The above example also omits any supporting methods, eg `hideXxx()`, `disableXxx()`, `validateXxx()`, etc.
+
+In the user interface the "documents" collection, the "add" and the "delete" actions will appear to be part of
+`Customer`.  In essence the framework constructs a composite UI from the parts of multiple objects.
+
+
+[TIP]
+====
+The (non-ASF) http://github.com/incodehq/incode-module-note[Incode note] and
+http://github.com/incodehq/incode-module-commchannel[Incode commchannel] modules are real-world examples that use this
+technique throughout.
+====
+
+
+
+== Contributing a single member
+
+The mixin can contribute as much or as little behaviour as makes sense.  For example, in the example above it might be
+that ``Document``s are created through some other mechanism (eg scanned) and are never deleted.  In that case, the
+mixin might be simply:
+
+[source,java]
+----
+@Mixin
+public class DocumentHolder_documents {
+    ..
+    public List<Document> documents() { ... }
+    ...
+}
+----
+
+
+For the case where there is only a single member being contributed, the special name "__" (that is, two underscores)
+can be used instead.  In this case, the contributee member's name will be inferred from the mixin's class name.  If the
+class name itself contains an underscore, then the last part of the class name will be used.
+
+Thus, for a mixin whose class name is `DocumentHolder_documents`, the effective member name is `documents`.  We could
+therefore rewrite the mixin as:
+
+[source,java]
+----
+@Mixin
+public class DocumentHolder_documents {
+    ..
+    public List<Document> __() { ... }
+    ...
+}
+----
+
+The benefit of this is marginal unless there are supporting methods, in which case the removal of boilerplate is welcome:
+
+[source,java]
+----
+@Mixin
+public class DocumentHolder_documents {
+    ..
+    public List<Document> __() { ... }
+    public boolean hide__() { ... }
+    public String disable__() { ... }
+    ...
+}
+----
+
+
+== Programmatic usage
+
+When a domain object is rendered, the framework will automatically instantiate all required mixins and delegate to them
+dynamically.  If writing integration tests or fixtures, or (sometimes) just regular domain logic, then you may need to
+instantiate mixins directly.
+
+For this you can use the
+xref:rg.adoc#_rg_services-api_manpage-DomainObjectContainer_object-creation-api[`DomainObjectContainer#mixin(...)`
+method.  For example:
+
+[source,java]
+----
+DocumentHolder_documents mixin = container.mixin(DocumentHolder_documents.class, customer);
+----
+
+The xref:ug.adoc#_ug_testing_integ-test-support_bootstrapping_IntegrationTestAbstract[`IntegrationTestAbstract`] and
+xref:rg.adoc#_rg_classes_super_manpage-FixtureScript[`FixtureScript`] classes both provide a `mixin(...)` convenience
+method.
+
+
+
+== Other reasons to use mixins
+
+In the introduction to this topic we mentioned that mixins are most useful for ensuring that the domain app remains
+decoupled.  This applies to the case where the contributee (eg `Customer`, being mixed into) is in one module, while
+the contributor mixin (`DocumentHolder_documents`) is in some other module.  The `customer` module knows about the
+`document` module, but not vice versa.
+
+However, you might also want to consider moving behaviour out of entities even within the same module, perhaps even
+within the same Java package.  And the reason for this is to support hot-reloading of Java classes, so that you can
+modify and recompile your application without having to restart it.  This can provide substantial productivity gains.
+
+The Hotspot JVM has limited support for hot reloading; generally you can change method implementations but you cannot
+introduce new methods.  However, the link:https://dcevm.github.io/[DCEVM] open source project will patch the JVM to
+support much more complete hot reloading support.  There are also, of course, commercial products such as JRebel.
+
+The main snag in all this is the DataNucleus enhancer... any change to entities is going to require the entity to be
+re-enhanced, and the JDO metamodel recreated, which usually "stuffs things up".  So hot-reloading of an app whose
+fundamental structure is changing is likely to remain a no-no.
+
+However, chances are that the structure of your domain objects (the data) will change much less rapidly than
+the behaviour of those domain objects.  Thus, it's the behaviour that you're most likely wanting to change while the
+app is still running.  If you move that behaviour out into mixins (or
+xref:ug.adoc#_ug_more-advanced_decoupling_contributions[contributed services]), then these can be reloaded happily.
+(When running in prototype mode), Apache Isis will automatically recreate the portion of the metamodel for any domain
+object as it is rendered.
+
+
+
+== Related reading
+
+Mixins are an implementation of the link:http://www.artima.com/articles/dci_vision.html[DCI architecture] architecture, as formulated and described by link:https://en.wikipedia.org/wiki/Trygve_Reenskaug[Trygve Reenskaug] and link:https://en.wikipedia.org/wiki/Jim_Coplien[Jim Coplien].  Reenskaug was the inventor of the MVC pattern (and also the external
+examiner for Richard Pawson's PhD thesis), while Coplien has a long history in object-orientation, C++ and patterns.
+
+DCI stands for Data-Context-Interaction and is presented as an evolution of object-oriented programming, but one where
+behaviour is bound to objects dynamically rather than statically in some context or other.  The `@Mixin`
+pattern is Apache Isis' straightforward take on the same basic concept.
+
+You might also wish to check out link:http://zest.apache.org[Apache Zest] (formerly Qi4J), which implements a much more
+general purpose implementation of the same concepts.
+

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/adocs/documentation/src/main/asciidoc/guides/_ug_testing_integ-test-support_bootstrapping.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ug_testing_integ-test-support_bootstrapping.adoc b/adocs/documentation/src/main/asciidoc/guides/_ug_testing_integ-test-support_bootstrapping.adoc
index bd5ceeb..612d35b 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ug_testing_integ-test-support_bootstrapping.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ug_testing_integ-test-support_bootstrapping.adoc
@@ -218,7 +218,7 @@ public abstract class DomainAppIntegTest {
 <3> primarily exists to support the writing of xref:ug.adoc#_ug_testing_bdd-spec-support[BDD specifications], but also enables finer-grained management of sessions/transactions (discussed below).
 
 
-
+[[_ug_testing_integ-test-support_bootstrapping_IntegrationTestAbstract]]
 === `IntegrationTestAbstract`
 
 In fact, we recommend that your base class inherit from Apache Isis' `IntegrationTestAbstract` class:

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstract.java
index ec23dab..70f5d2d 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstract.java
@@ -325,7 +325,7 @@ public abstract class ObjectActionParameterAbstract implements ObjectActionParam
             final InteractionInitiatedBy interactionInitiatedBy) {
         final List<ObjectAdapter> argListIfAvailable = ListExtensions.mutableCopy(argumentsIfAvailable);
         
-        final ObjectAdapter target = targetForDefaultOrChoices(adapter, argListIfAvailable);
+        final ObjectAdapter target = targetForDefaultOrChoicesOrValidate(adapter);
         final List<ObjectAdapter> args = argsForDefaultOrChoices(adapter, argListIfAvailable);
         
         return findChoices(target, args, interactionInitiatedBy);
@@ -363,7 +363,7 @@ public abstract class ObjectActionParameterAbstract implements ObjectActionParam
     @Override
     public ObjectAdapter getDefault(final ObjectAdapter adapter) {
         
-        final ObjectAdapter target = targetForDefaultOrChoices(adapter, null);
+        final ObjectAdapter target = targetForDefaultOrChoicesOrValidate(adapter);
         final List<ObjectAdapter> args = argsForDefaultOrChoices(adapter, null);
         
         return findDefault(target, args);
@@ -388,9 +388,7 @@ public abstract class ObjectActionParameterAbstract implements ObjectActionParam
     /**
      * Hook method; {@link ObjectActionParameterContributee contributed action parameter}s override.
      */
-    protected ObjectAdapter targetForDefaultOrChoices(
-            final ObjectAdapter adapter,
-            final List<ObjectAdapter> argumentsIfAvailable) {
+    protected ObjectAdapter targetForDefaultOrChoicesOrValidate(final ObjectAdapter adapter) {
         return adapter;
     }
 
@@ -450,21 +448,22 @@ public abstract class ObjectActionParameterAbstract implements ObjectActionParam
 
     @Override
     public ActionArgumentContext createProposedArgumentInteractionContext(
-            final ObjectAdapter targetObject,
+            final ObjectAdapter objectAdapter,
             final ObjectAdapter[] proposedArguments,
             final int position,
             final InteractionInitiatedBy interactionInitiatedBy) {
-        return new ActionArgumentContext(targetObject, getIdentifier(), proposedArguments,
-                position, interactionInitiatedBy);
+        //final ObjectAdapter targetAdapter = targetForDefaultOrChoicesOrValidate(objectAdapter);
+        return new ActionArgumentContext(
+                objectAdapter, getIdentifier(), proposedArguments, position, interactionInitiatedBy);
     }
 
     @Override
     public String isValid(
-            final ObjectAdapter adapter,
+            final ObjectAdapter objectAdapter,
             final Object proposedValue,
             final InteractionInitiatedBy interactionInitiatedBy,
             final Localization localization) {
-        
+
         ObjectAdapter proposedValueAdapter = null;
         ObjectSpecification proposedValueSpec;
         if(proposedValue != null) {
@@ -478,9 +477,10 @@ public abstract class ObjectActionParameterAbstract implements ObjectActionParam
             }
         }
 
+        final ObjectAdapter targetAdapter = targetForDefaultOrChoicesOrValidate(objectAdapter);
         final ObjectAdapter[] argumentAdapters = arguments(proposedValueAdapter);
         final ValidityContext<?> ic = createProposedArgumentInteractionContext(
-                adapter, argumentAdapters, getNumber(), interactionInitiatedBy
+                targetAdapter, argumentAdapters, getNumber(), interactionInitiatedBy
         );
 
         final InteractionResultSet buf = new InteractionResultSet();

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneActionParameterContributee.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneActionParameterContributee.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneActionParameterContributee.java
index 00f4c89..ea4ac4e 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneActionParameterContributee.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneActionParameterContributee.java
@@ -49,9 +49,7 @@ public class OneToOneActionParameterContributee extends OneToOneActionParameterD
                 interactionInitiatedBy);
     }
 
-    protected ObjectAdapter targetForDefaultOrChoices(
-            final ObjectAdapter adapter,
-            final List<ObjectAdapter> argumentsIfAvailable) {
+    protected ObjectAdapter targetForDefaultOrChoicesOrValidate(final ObjectAdapter adapter) {
         return serviceAdapter;
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneActionParameterMixedIn.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneActionParameterMixedIn.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneActionParameterMixedIn.java
index 1d4a7ce..96221ea 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneActionParameterMixedIn.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneActionParameterMixedIn.java
@@ -16,8 +16,6 @@
  */
 package org.apache.isis.core.metamodel.specloader.specimpl;
 
-import java.util.List;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
 import org.apache.isis.core.metamodel.spec.feature.ObjectActionParameter;
@@ -45,9 +43,7 @@ public class OneToOneActionParameterMixedIn extends OneToOneActionParameterDefau
                 interactionInitiatedBy);
     }
 
-    protected ObjectAdapter targetForDefaultOrChoices(
-            final ObjectAdapter mixedInAdapter,
-            final List<ObjectAdapter> argumentsIfAvailable) {
+    protected ObjectAdapter targetForDefaultOrChoicesOrValidate(final ObjectAdapter mixedInAdapter) {
         return mixinAdapterFor(mixedInAdapter);
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/342da9cf/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
index 5bf63dc..c70d616 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionParameterAbstractTest_getId_and_getName.java
@@ -81,7 +81,7 @@ public class ObjectActionParameterAbstractTest_getId_and_getName {
 
         @Override
         public String isValid(
-                final ObjectAdapter adapter,
+                final ObjectAdapter objectAdapter,
                 final Object proposedValue,
                 final InteractionInitiatedBy interactionInitiatedBy, final Localization localization) {
             return null;


Re: isis git commit: ISIS-1213: updating docs for mixins. Also fix for parameter validation

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
ok, thanks for that, really useful.

Either will just get rid of the feature, or look for some other special
"reserved" name.  $$ ??

On 16 October 2015 at 19:02, Martin Grigorov <mg...@apache.org> wrote:

> Here is where I've heard of this :
> https://github.com/javaslang/javaslang/issues/242
> The summary is at
> https://github.com/javaslang/javaslang/issues/242#issuecomment-102707841
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Oct 16, 2015 at 7:55 PM, Dan Haywood <dan@haywood-associates.co.uk
> >
> wrote:
>
> > Yes, I saw a message about that, for a single underscore... which is why
> I
> > changed to a double underscore.
> >
> > Do we think that that's a bad idea too?  I kind of like the concept of a
> > "default" name somehow.
> >
> > On 16 October 2015 at 18:46, Martin Grigorov <mg...@apache.org>
> wrote:
> >
> > > Hi Dan,
> > >
> > > On Fri, Oct 16, 2015 at 7:29 PM, <da...@apache.org> wrote:
> > >
> > > > +For the case where there is only a single member being contributed,
> > the
> > > > special name "__" (that is, two underscores)
> > > > +can be used instead.  In this case, the contributee member's name
> will
> > > be
> > > > inferred from the mixin's class name.  If the
> > > > +class name itself contains an underscore, then the last part of the
> > > class
> > > > name will be used.
> > > >
> > >
> > > AFAIK usage of underscore as a prefix in names (and especially two
> > > consecutive underscores) is is kind of deprecated in Java 8 and most
> > > probably won't compile in Java 9.
> > > I think I've seen IDEA 14+ to log compilation warnings when such a
> > > detected.
> > >
> > > I remember seeing a answer by Brian Goetz somewhere but I cannot find
> it
> > > now.
> > > Here is an answer in SO: http://stackoverflow.com/a/23525446/497381
> > >
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> >
>

Re: isis git commit: ISIS-1213: updating docs for mixins. Also fix for parameter validation

Posted by Martin Grigorov <mg...@apache.org>.
Here is where I've heard of this :
https://github.com/javaslang/javaslang/issues/242
The summary is at
https://github.com/javaslang/javaslang/issues/242#issuecomment-102707841

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Oct 16, 2015 at 7:55 PM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> Yes, I saw a message about that, for a single underscore... which is why I
> changed to a double underscore.
>
> Do we think that that's a bad idea too?  I kind of like the concept of a
> "default" name somehow.
>
> On 16 October 2015 at 18:46, Martin Grigorov <mg...@apache.org> wrote:
>
> > Hi Dan,
> >
> > On Fri, Oct 16, 2015 at 7:29 PM, <da...@apache.org> wrote:
> >
> > > +For the case where there is only a single member being contributed,
> the
> > > special name "__" (that is, two underscores)
> > > +can be used instead.  In this case, the contributee member's name will
> > be
> > > inferred from the mixin's class name.  If the
> > > +class name itself contains an underscore, then the last part of the
> > class
> > > name will be used.
> > >
> >
> > AFAIK usage of underscore as a prefix in names (and especially two
> > consecutive underscores) is is kind of deprecated in Java 8 and most
> > probably won't compile in Java 9.
> > I think I've seen IDEA 14+ to log compilation warnings when such a
> > detected.
> >
> > I remember seeing a answer by Brian Goetz somewhere but I cannot find it
> > now.
> > Here is an answer in SO: http://stackoverflow.com/a/23525446/497381
> >
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
>

Re: isis git commit: ISIS-1213: updating docs for mixins. Also fix for parameter validation

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Yes, I saw a message about that, for a single underscore... which is why I
changed to a double underscore.

Do we think that that's a bad idea too?  I kind of like the concept of a
"default" name somehow.

On 16 October 2015 at 18:46, Martin Grigorov <mg...@apache.org> wrote:

> Hi Dan,
>
> On Fri, Oct 16, 2015 at 7:29 PM, <da...@apache.org> wrote:
>
> > +For the case where there is only a single member being contributed, the
> > special name "__" (that is, two underscores)
> > +can be used instead.  In this case, the contributee member's name will
> be
> > inferred from the mixin's class name.  If the
> > +class name itself contains an underscore, then the last part of the
> class
> > name will be used.
> >
>
> AFAIK usage of underscore as a prefix in names (and especially two
> consecutive underscores) is is kind of deprecated in Java 8 and most
> probably won't compile in Java 9.
> I think I've seen IDEA 14+ to log compilation warnings when such a
> detected.
>
> I remember seeing a answer by Brian Goetz somewhere but I cannot find it
> now.
> Here is an answer in SO: http://stackoverflow.com/a/23525446/497381
>
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>

Re: isis git commit: ISIS-1213: updating docs for mixins. Also fix for parameter validation

Posted by Martin Grigorov <mg...@apache.org>.
Hi Dan,

On Fri, Oct 16, 2015 at 7:29 PM, <da...@apache.org> wrote:

> +For the case where there is only a single member being contributed, the
> special name "__" (that is, two underscores)
> +can be used instead.  In this case, the contributee member's name will be
> inferred from the mixin's class name.  If the
> +class name itself contains an underscore, then the last part of the class
> name will be used.
>

AFAIK usage of underscore as a prefix in names (and especially two
consecutive underscores) is is kind of deprecated in Java 8 and most
probably won't compile in Java 9.
I think I've seen IDEA 14+ to log compilation warnings when such a detected.

I remember seeing a answer by Brian Goetz somewhere but I cannot find it
now.
Here is an answer in SO: http://stackoverflow.com/a/23525446/497381


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov