[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-07-07 Thread Radu Cotescu (JIRA)

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

Radu Cotescu commented on SLING-5753:
-

I have to agree with Justin's comment \[0\]: implementing this enhancement will 
lead to inconsistency regarding Sling Models instantiation depending on the 
consumer. Since anything that can be performed in 
{{Use#init(javax.script.Bindings)}} can be accomplished through injection 
annotations and / or {{@PostConstruct}} I don't see a compelling reason for 
applying the attached patch.

\[0\] - 
https://issues.apache.org/jira/browse/SLING-5753?focusedCommentId=15308307=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15308307

> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Jordan Shurmer (JIRA)

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

Jordan Shurmer commented on SLING-5753:
---

I'm just adding my own opinion to the conversation though, I totally defer to 
others who have more knowledge of sightly/sling projects for whether this 
"belongs" in here or not.

> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Jordan Shurmer (JIRA)

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

Jordan Shurmer commented on SLING-5753:
---

I see. So the concern is that developers would assume that the calling of the 
init() method is part of the Models stuff in general and try to use their "use" 
models in other contexts... I can understand that concern.

However, should that stop sightly from doing this? If a developer understand 
the Use API and choose to use it they seem to be keen on using that object in 
Sightly only... whether it's a Sling Model or not... the fact that they then 
want to use Sling Models as well is separate from that.  In other words, I view 
this as being about the Use API supporting Sling Models, rather than Sling 
Models supporting the Use API...

> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Justin Edelson (JIRA)

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

Justin Edelson commented on SLING-5753:
---

Aside from this being a slippery slope, my larger concern is that it creates an 
inconsistency between creating the model through Sightly and any other way. 
What would happen if this patch was applied is that the init method would get 
called *only* when creating the model through Sightly. Doing it from Java code 
or a JSP or an ECMAScript and the init method wouldn't get called. 

> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Jordan Shurmer (JIRA)

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

Jordan Shurmer commented on SLING-5753:
---

I'm having trouble understanding why this would be a bad idea. They only point 
I can see is that a Model which also implements the Use api is less flexible, 
but seeing as how this change is specifically in the Sightly scripting bundle I 
don't see how that is a problem. If someone wants to have an object which is a 
Model and is also ran through the Sightly Use API why shouldn't they? 

I see this adding some nice functionality which help two pieces of the Sling 
world work better together.

> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Justin Edelson (JIRA)

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

Justin Edelson commented on SLING-5753:
---

[~lsantha] where would you suggest this be documented?

> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Levente Santha (JIRA)

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

Levente Santha commented on SLING-5753:
---

Thank you guys for your feedback. 
The point I wanted to make here was to provide a simple transition path for a 
Java Use API based solution involving class hierarchies towards Sling Models.
I can certainly use @PostConstruct (or rewrite code using it) but that will not 
make Sling Models interoperable with Use objects. Also the documentation could 
make this clear.




> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Vlad Bailescu (JIRA)

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

Vlad Bailescu commented on SLING-5753:
--

[~lsantha], I also believe any hybrid classes (that want to use both Sling 
Models and Use POJOs APIs) should handle the two alternate initialization paths 
themselves.

> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Justin Edelson (JIRA)

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

Justin Edelson commented on SLING-5753:
---

+1 to [~kwin]'s comments. Use @PostConstruct.

> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Levente Santha (JIRA)

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

Levente Santha commented on SLING-5753:
---

1. If a Sling Model class implements the Use interface or extends a class 
implementing it, that certainly means that the particular model would be 
supporting a Sightly script. This actually extends the domain of application of 
Sling Models as a tool while providing support for a domain not covered so far.
2. If I look at the design goals of Sling Models the anomaly described here 
clearly goes against some of them.
3. It's quite intrusive behavior to add an annotation and as a result have some 
functionality disabled in my class. I want to enhance my classes not to reduce 
them and then work on rewriting lost functionality. (It might also violate the 
JLS [1].) 

[1]https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.7


> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Konrad Windszus (JIRA)

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

Konrad Windszus commented on SLING-5753:


It just reduces flexibililty of those models (because they can only be used 
with Sightly and this Use Provider). Also I don't see any reason why we should 
support that.

> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Levente Santha (JIRA)

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

Levente Santha commented on SLING-5753:
---

Is there any other conflict between the two approaches why mixing them would be 
discouraged (beyond the problem described here)?


> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-5753) Use.init() not invoked for Java Use object which is also a Sling Model

2016-05-31 Thread Konrad Windszus (JIRA)

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

Konrad Windszus commented on SLING-5753:


IMHO you should either use the Use interface or Sling Models but not mix the 
two approaches. Why can't you use the postcontruct from Sling Models for doing 
the initialization.

> Use.init() not invoked for Java Use object which is also a Sling Model
> --
>
> Key: SLING-5753
> URL: https://issues.apache.org/jira/browse/SLING-5753
> Project: Sling
>  Issue Type: Bug
>  Components: Scripting
>Affects Versions: Scripting Sightly Models Use Provider 1.0.0
>Reporter: Levente Santha
>Priority: Minor
> Attachments: SLING_5753.patch
>
>
> [~kwin],
> In the situation where I start with a Java Use object and later decide to use 
> some convenient features of Sling Models, I have the surprise to experience 
> that as soon as my Java Use object gets the @Model annotation its init() 
> method is not invoked any more.
> I can see no good reason for this, so I created a patch to fix it.
> Please let me know what you think.
> Thank you, Levente



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)