[ 
https://issues.apache.org/jira/browse/SLING-8450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16851042#comment-16851042
 ] 

Brendan Robert edited comment on SLING-8450 at 5/29/19 4:33 PM:
----------------------------------------------------------------

This is a more modern alternative to Jackrabbit OCM with some seriously large 
differences:

1) Unit test coverage
 2) Recursive data structure support, including arrays, lists, maps, and child 
objects (OCM doesn't support nested/recursive structures)
 3) Where annotation concerns overlap with Sling Models, the sling model 
annotations are used instead (such as @named – OCM uses its own annotations, 
and many of them.)
 4) Companion to Sling Models, so anything that sling models can adaptTo can 
also be persisted with this service.

5) Fewer dependencies.  Jackrabbit OCM is actually rather hard to build and 
include because it includes a large chain of dependencies, many of which are 
rather outdated.


was (Author: brobert):
This is a more modern alternative to Jackrabbit OCM with some seriously large 
differences:

1) Unit test coverage
2) Recursive data structure support, including arrays, lists, maps, and child 
objects (OCM doesn't support nested/recursive structures)
3) Where annotation concerns overlap with Sling Models, the sling model 
annotations are used instead (such as @named – OCM uses its own annotations, 
and many of them.)
4) Companion to Sling Models, so anything that sling models can adaptTo can 
also be persisted with this service.

> JcrPersist: Provide transparent persistence to Sling Models
> -----------------------------------------------------------
>
>                 Key: SLING-8450
>                 URL: https://issues.apache.org/jira/browse/SLING-8450
>             Project: Sling
>          Issue Type: New Feature
>          Components: API
>            Reporter: Brendan Robert
>            Priority: Major
>         Attachments: SlingJCRPersist.zip
>
>
> As a developer using sling, I would like my sling models to serve as a core 
> of a MVC coding paradigm; however, it is not possible to do this without 
> writing my own persistence logic to save my sling models back into resources 
> for every project I do this.
> I propose a new module to work in tandem with Sling Models, such that Sling 
> Models serve as a mechanism to load data from JCR and the JcrPersist module 
> provides an OSGi service to save changes to beans back to the JCR via a 
> persist method.
> There are some complex sling model features, such as @via, which will likely 
> not be subject to this feature, and other cases such as transient variables 
> that should not be persisted.  The persist service should provide the 
> developer a sufficient set of features to decide how much or how little is 
> persisted with it.  Like Sling Models, this should rely on annotations so 
> that no additional external configurations are needed.
>  
> PS: Here's the implementation with ~90% unit test coverage.  See attached. :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to