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/07/04 20:21:33 UTC
[causeway] 08/08: CAUSEWAY-3450 : updates docs on view models
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 94b9127c3abf587932b9e41bff540f9d27b98571
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Jul 4 21:20:07 2023 +0100
CAUSEWAY-3450 : updates docs on view models
---
.../modules/ROOT/partials/view-models/non-jaxb-view-models.adoc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/antora/components/userguide/modules/ROOT/partials/view-models/non-jaxb-view-models.adoc b/antora/components/userguide/modules/ROOT/partials/view-models/non-jaxb-view-models.adoc
index cb2d63e751..47aa71c617 100644
--- a/antora/components/userguide/modules/ROOT/partials/view-models/non-jaxb-view-models.adoc
+++ b/antora/components/userguide/modules/ROOT/partials/view-models/non-jaxb-view-models.adoc
@@ -5,10 +5,9 @@
:page-partial:
-
Instead of using JAXB to specify a view model, it is also possible to simply rely on the fact that the view model is annotated with xref:refguide:applib:index/annotation/DomainObject.adoc#nature[@DomainObject]xref:refguide:applib:index/annotation/Nature.adoc#VIEW_MODEL[(nature=VIEW_MODEL)].
-With this approach thestate of properties -- but not collections -- is serialized.
+With this approach the state of properties -- but not collections -- is serialized.
So this approach is not as powerful as using the JAXB-style of view models, on the other hand it takes little effort.
For example:
@@ -44,5 +43,10 @@ public class CompareCustomers {
+
Note that they do _not_ need to be visible, however.
+Of all the alternative ways to implement a view model, this is probably the simplest.
+However, it also has the most limitations.
+As noted above, it can only capture the values of properties, not collections.
+Moreover, those property types must be built-in value types or to entities.
+It is *_not_* possible though to reference another view model instance.