You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2023/03/17 06:55:12 UTC

[causeway] 02/02: CAUSEWAY-3381: updates javadoc for Nature.BEAN

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit af2f0ca9609ccdeeca2c00058ac54e4ff3a86a99
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Mar 17 06:54:46 2023 +0000

    CAUSEWAY-3381: updates javadoc for Nature.BEAN
    
    ... provides a couple of potential use cases for this feature.
---
 .../apache/causeway/applib/annotation/Nature.java  | 29 +++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/api/applib/src/main/java/org/apache/causeway/applib/annotation/Nature.java b/api/applib/src/main/java/org/apache/causeway/applib/annotation/Nature.java
index 56ef5afda1..f007a9dfb8 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/annotation/Nature.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/annotation/Nature.java
@@ -78,8 +78,35 @@ public enum Nature {
      * An object that is entirely managed by the underlying IoC container.
      *
      * <p>
+     *     Some possible use cases for this are:
+     *
+     *     <ul>
+     *         <li>
+     *             <p>
+     *                 As a helper service that is used to emit messages through {@link Action#executionPublishing()}.
+     *             </p>
+     *             <p>
+     *                 The service itself isn't rendered anywhere, but its actions can be invoked through the {@link org.apache.causeway.applib.services.wrapper.WrapperFactory}.
+     *                 (Or as a variant, it might expose a {@link Programmatic} API and then delegate to its own action via the {@link org.apache.causeway.applib.services.wrapper.WrapperFactory}.
+     *             </p>
+     *         </li>
+     *         <li>
+     *             <p>
+     *                 As a service representing a facade to a module, so that code in another (untrusted) module can only execute through {@link Action}s
+     *             </p>
+     *             <p>
+     *                 Again, either the calling module is expected to use the {@link org.apache.causeway.applib.services.wrapper.WrapperFactory} when invoking
+     *                 the facade service, or - since the calling code is treated untrusted - then the same self-delegation approach as for the previous example could be used,
+     *                 whereby the facade service exposes a {@link Programmatic} API and then delegates to its own action via the {@link org.apache.causeway.applib.services.wrapper.WrapperFactory}.
+     *             </p>
+     *         </li>
+     *     </ul>
+     * </p>
+     *
+     *
+     * <p>
      *     <b>IMPORTANT</b> the class must <i>also</i> be annotated with an appropriate
-     *     {@link org.springframework.context.annotation.Scope}, eg <code>@Scope(&quot;prototype&quot;)</code> or <code>@Scope(&quot;singleton&quot;)</code>
+     *     {@link org.springframework.context.annotation.Scope}, eg <code>@Scope(&quot;singleton&quot;)</code> or <code>@Scope(&quot;prototype&quot;)</code>
      * </p>
      *
      * @apiNote EXPERIMENTAL