I really appreciate the thought that you put into this. 

If you are utilizing the JCR Resource Provider to store a resource you have to 
declare a jcr:primaryType, and you are then bound by the definition of the node 
as to what you can add as an attribute or a child type.  So there is such thing 
as "creating a  resource without a JCR node type" if that resource is to be 
persisted in the JCR.

One of the core tenants of Sling is that everything is a Resource. One of my 
expectations of a Type system is that I can create a type by POST and retrieve 
the structure of the type via a GET.  That the  definitions of a Type are 
themselves resources.

I may be missing this from your whitepaper, is that doable?

--
Jason

On Tue, Jan 8, 2019, at 9:11 AM, Christanto Leonardo wrote:
> Hi,
> 
> > 5. you describe it should be possible to derive data models from JCR CND
> definitions. do you think this should be the major use case? JCR CND
> definitions are quite out-of-fashion nowadays, and used more for historical
> reasons (or for performance optimizations because oak indexes are based on
> them). the tooling around them is not good (e.g. difficult to
> update/replace them in a running system).
> 
> The purpose of the Sling Modeling Framework is to model your applications,
> possibly the existing ones.
> So if you have an existing resource defined in JCR with all the node types
> (e.g. cq:PageContent resource), the modeling framework must be able to
> model that.
> If you create a new resource without JCR node type, then when defining that
> resource type you don't need to use CND.
> 
> I think it is already explained at:
> 
>    1.
>    
> https://github.com/christanto/sling-whiteboard/blob/master/modeling/docs/explainer.md#data-modeling-using-jcr-node-types
>    2.
>    
> https://github.com/christanto/sling-whiteboard/blob/master/modeling/docs/explainer.md#modeling-the-underlying-platforms-typing-system
> 
> Cheers,
> Christanto
> 
> 
> On Tue, Jan 8, 2019 at 6:44 PM Stefan Seifert <[email protected]>
> wrote:
> 
> > hello christanto.
> >
> > thanks for bringing this up! some first questions after a first read:
> >
> > 1. why defining a new "DSL" to describe the model metadata? what's with
> > existing things like json schema. defining a completely new DSL often has
> > the risk of not getting it "right" in the first place.
> >
> > 2. do you plan to support only a single resource/node and it's properties.
> > what's with sub tree structures, that are supported by JCR CND definitions?
> > more complex data models like forms are unlikely to be represented by a
> > single resource. or maybe that is already covered with the property
> > handlers although the name does not indicate it.
> >
> > 3. one of the reasons why sling is why it is (without an explicit modeling
> > capability) is the rule #1 of david's model "Data First, Structure Later.
> > Maybe." [1]. this was stated a very long time ago. would be nice if you can
> > add a reference to your explainer page to it as well and explain why you
> > think different nowadays (i think there are good reasons for it, but it
> > always depends on the use cases).
> >
> > 4. the name "Models" can be mixed up with "Sling Models" [2] which points
> > somewhat into the same direction but is currently based on different
> > concepts and is already used much. but i suppose this can be sorted out
> > later to decide if this new approach can be "Sling Models 2.0" or the new
> > things should get a different name (like Type System). still it would make
> > sense to also add a reference to sling models to the explainer.
> >
> > 5. you describe it should be possible to derive data models from JCR CND
> > definitions. do you think this should be the major use case? JCR CND
> > definitions are quite out-of-fashion nowadays, and used more for historical
> > reasons (or for performance optimizations because oak indexes are based on
> > them). the tooling around them is not good (e.g. difficult to
> > update/replace them in a running system).
> >
> > 6. you describe some "other models" like FormModel, ActionsModel which
> > sound like hypermedia support. i do not fully understand how hypermedia
> > support fits into the other parts you describe which primarily describe the
> > data model and not the actions for them. where does this hypermedia
> > metadata come from?
> >
> > stefan
> >
> > [1] https://wiki.apache.org/jackrabbit/DavidsModel
> > [2] https://sling.apache.org/documentation/bundles/models.html
> >
> >
> >
> > >-----Original Message-----
> > >From: Christanto Leonardo [mailto:[email protected]]
> > >Sent: Tuesday, January 8, 2019 4:03 AM
> > >To: [email protected]
> > >Subject: Re: Sling Type System: started a wiki page for concepts, ideas,
> > >motivation
> > >
> > >Hello,
> > >
> > >I am currently working on the proposal to introduce the concept of
> > modeling
> > >in Sling. See it at <
> > >https://github.com/christanto/sling-whiteboard/tree/master/modeling>.
> > >One is especially encouraged to read the explainer at <
> > >https://github.com/christanto/sling-
> > >whiteboard/blob/master/modeling/docs/explainer.md
> > >>.
> > >
> > >My hope is that the Sling Modeling Framework can provide the ability to
> > >model many concepts in the application, starting with the typing system of
> > >the resource (i.e. the resource type definition) as the lowest layer.
> > >
> > >Please let me know what you think. I plan to continue developing this
> > >proposal.
> > >
> > >Cheers,
> > >Christanto
> > >
> > >On 2018/10/02 11:59:08, Bertrand Delacretaz <[email protected]> wrote:
> > >> Hi,>
> > >>
> > >> Recent discussions with a number of people from the Sling community>
> > >> [1] have helped clarify my thoughts about this, I have started a wiki>
> > >> page at
> > >
> > https://cwiki.apache.org/confluence/display/SLING/Sling+Type+System%3A+moti
> > >vation+and+requirements>
> > >
> > >> and feedback is welcome, on that page or here.>
> > >>
> > >> Roughly, the goal is to create a Sling Type System that defines much>
> > >> more precisely what the various Resource Types can contain, how they>
> > >> work together, etc. with the goal of generating self-describing>
> > >> interfaces.>
> > >>
> > >> Let's see where this leads, it's just rough ideas so far but it feels>
> > >> like a useful unifying concept for Sling.>
> > >>
> > >> -Bertrand>
> > >>
> > >> [1] along with reading "a conversation with Alan Kay, creator of>
> > >> Smalltalk" - https://queue.acm.org/detail.cfm?id=1039523>
> > >>
> >
>

Reply via email to