Composition policy takes child instance

The composition policy now takes a child instance instead
of the child type, as in all cases we have access to the child
object.

This allows new-style objects to be contained by old-style objects.

Updated all composition policies to use standardized argument names
instead of `context` and `candidate`; this makes it easier to
understand.

Updated AddActionProvider to hardcode the object types supported.
This commit is contained in:
Pete Richards
2017-02-21 12:14:09 -08:00
parent 46c7399867
commit 65325b90fd
15 changed files with 56 additions and 426 deletions

View File

@ -2261,10 +2261,7 @@ The platform understands the following policy categories (specifiable as the
* `action`: Determines whether or not a given action is allowable. The candidate
argument here is an Action; the context is its action context object.
* `composition`: Determines whether or not domain objects of a given type are
allowed to contain domain objects of another type. The candidate argument here
is the container's `Type`; the context argument is the `Type` of the object to be
contained.
* `composition`: Determines whether or not domain objects of a given type (first argument, `parentType`) can contain a given object (second argument, `child`).
* `view`: Determines whether or not a view is applicable for a domain object.
The candidate argument is the view's extension definition; the context argument
is the `DomainObject` to be viewed.