Re: [Sling Models documentation] discourage the use of @Inject

2023-01-12 Thread Jörg Hoh
Hi all,

As the PR got quite complex with its many changes and moves of content, I
merged the doc update yesterday, you can check the result at
https://sling.apache.org/documentation/bundles/models.html.

if you find any inconsistencies or plain errors, please let me know, I plan
to do another PR on top with minor improvements.

Jörg



Am Mi., 21. Dez. 2022 um 15:41 Uhr schrieb Jörg Hoh :

>
> Many thanks for the feedback Stefan! I updated the PR.
>
> Can someone else help with the conversion of the @Via examples to the
> injector-specific annotations?
>
> Jörg
>
> Am Mi., 21. Dez. 2022 um 10:05 Uhr schrieb Stefan Seifert
> :
>
>> thanks for the work!
>>
>> to make it easier to comment i've created a pull request with your
>> changes and added some cosmetic comments:
>> https://github.com/apache/sling-site/pull/106
>>
>> overall, looks very good to me. i think i've never used the @via
>> annotation, cannot help much here.
>>
>> the new "performance" section is also a good read, which was not
>> summarized in that why before afaik.
>>
>> stefan
>>
>>
>>
>> > Am Do., 8. Dez. 2022 um 10:45 Uhr schrieb Stefan Seifert
>> > :
>> >
>> > > +1
>> > >
>> > > using @Inject is not only a performance problem, it also may lead to
>> > > unexpected results if an injector steps in you are not aware of.
>> > >
>> > > stefan
>> > >
>> > > > -Original Message-
>> > > > From: Jörg Hoh 
>> > > > Sent: Thursday, December 8, 2022 10:25 AM
>> > > > To: Sling Developers List 
>> > > > Subject: [Sling Models documentation] discourage the use of @Inject
>> > > >
>> > > > Hi,
>> > > >
>> > > > currently the the Sling Models documentation is a bit confusing; the
>> > > > examples show only the use of the "@Inject" annotation, while more
>> > > > down (at
>> > > > [1]) in an not obvious location the use of @Inject is discouraged.
>> > > > Also, when I benchmarked the use of Sling Models with different
>> > > > annotations [2] I found that in some situations @Inject can have a
>> > > > huge performance penalty compared to the injector-specfic
>> > > > annotations, so I would also argue from this perspective, that we
>> > > > should heavily discourage the use of @Inject.
>> > > >
>> > > > But at the top we state as one of the design goals of Sling Models
>> > > > to use standard annotations (which are mostly discouraged at [1] in
>> > > > favor of custom annotations).
>> > > >
>> > > > In the context of SLING-11711 I plan to  rework the documentaiton
>> > > > and
>> > > all
>> > > > examples to use injector-specific annotations, remove the design
>> > > > goal of standard annotations, and mention the discouraged
>> > > > annotations only in a separate section as discouraged (not
>> > deprecated!).
>> > > >
>> > > > WDYT?
>> > > >
>> > > > Jörg
>> > > >
>> > > >
>> > > > [0] https://sling.apache.org/documentation/bundles/models.html
>> > > > [1]
>> > > > https://sling.apache.org/documentation/bundles/models.html#hints-1
>> > > > [2] https://cqdump.joerghoh.de/2022/11/28/sling-model-performance/
>> > > > [3] https://issues.apache.org/jira/browse/SLING-11711
>> > > > --
>> > > > Cheers,
>> > > > Jörg Hoh,
>> > > >
>> > > > https://cqdump.joerghoh.de
>> > > > Twitter: @joerghoh
>> > >
>> >
>> >
>> > --
>> > Cheers,
>> > Jörg Hoh,
>> >
>> > https://cqdump.joerghoh.de
>> > Twitter: @joerghoh
>>
>
>
> --
> Cheers,
> Jörg Hoh,
>
> https://cqdump.joerghoh.de
> Twitter: @joerghoh
>


-- 
Cheers,
Jörg Hoh,

https://cqdump.joerghoh.de
Twitter: @joerghoh


Re: [Sling Models documentation] discourage the use of @Inject

2022-12-21 Thread Jörg Hoh
Many thanks for the feedback Stefan! I updated the PR.

Can someone else help with the conversion of the @Via examples to the
injector-specific annotations?

Jörg

Am Mi., 21. Dez. 2022 um 10:05 Uhr schrieb Stefan Seifert
:

> thanks for the work!
>
> to make it easier to comment i've created a pull request with your changes
> and added some cosmetic comments:
> https://github.com/apache/sling-site/pull/106
>
> overall, looks very good to me. i think i've never used the @via
> annotation, cannot help much here.
>
> the new "performance" section is also a good read, which was not
> summarized in that why before afaik.
>
> stefan
>
>
>
> > Am Do., 8. Dez. 2022 um 10:45 Uhr schrieb Stefan Seifert
> > :
> >
> > > +1
> > >
> > > using @Inject is not only a performance problem, it also may lead to
> > > unexpected results if an injector steps in you are not aware of.
> > >
> > > stefan
> > >
> > > > -Original Message-
> > > > From: Jörg Hoh 
> > > > Sent: Thursday, December 8, 2022 10:25 AM
> > > > To: Sling Developers List 
> > > > Subject: [Sling Models documentation] discourage the use of @Inject
> > > >
> > > > Hi,
> > > >
> > > > currently the the Sling Models documentation is a bit confusing; the
> > > > examples show only the use of the "@Inject" annotation, while more
> > > > down (at
> > > > [1]) in an not obvious location the use of @Inject is discouraged.
> > > > Also, when I benchmarked the use of Sling Models with different
> > > > annotations [2] I found that in some situations @Inject can have a
> > > > huge performance penalty compared to the injector-specfic
> > > > annotations, so I would also argue from this perspective, that we
> > > > should heavily discourage the use of @Inject.
> > > >
> > > > But at the top we state as one of the design goals of Sling Models
> > > > to use standard annotations (which are mostly discouraged at [1] in
> > > > favor of custom annotations).
> > > >
> > > > In the context of SLING-11711 I plan to  rework the documentaiton
> > > > and
> > > all
> > > > examples to use injector-specific annotations, remove the design
> > > > goal of standard annotations, and mention the discouraged
> > > > annotations only in a separate section as discouraged (not
> > deprecated!).
> > > >
> > > > WDYT?
> > > >
> > > > Jörg
> > > >
> > > >
> > > > [0] https://sling.apache.org/documentation/bundles/models.html
> > > > [1]
> > > > https://sling.apache.org/documentation/bundles/models.html#hints-1
> > > > [2] https://cqdump.joerghoh.de/2022/11/28/sling-model-performance/
> > > > [3] https://issues.apache.org/jira/browse/SLING-11711
> > > > --
> > > > Cheers,
> > > > Jörg Hoh,
> > > >
> > > > https://cqdump.joerghoh.de
> > > > Twitter: @joerghoh
> > >
> >
> >
> > --
> > Cheers,
> > Jörg Hoh,
> >
> > https://cqdump.joerghoh.de
> > Twitter: @joerghoh
>


-- 
Cheers,
Jörg Hoh,

https://cqdump.joerghoh.de
Twitter: @joerghoh


RE: [Sling Models documentation] discourage the use of @Inject

2022-12-21 Thread Stefan Seifert
thanks for the work!

to make it easier to comment i've created a pull request with your changes and 
added some cosmetic comments:
https://github.com/apache/sling-site/pull/106

overall, looks very good to me. i think i've never used the @via annotation, 
cannot help much here.

the new "performance" section is also a good read, which was not summarized in 
that why before afaik.

stefan 



> Am Do., 8. Dez. 2022 um 10:45 Uhr schrieb Stefan Seifert
> :
> 
> > +1
> >
> > using @Inject is not only a performance problem, it also may lead to
> > unexpected results if an injector steps in you are not aware of.
> >
> > stefan
> >
> > > -Original Message-
> > > From: Jörg Hoh 
> > > Sent: Thursday, December 8, 2022 10:25 AM
> > > To: Sling Developers List 
> > > Subject: [Sling Models documentation] discourage the use of @Inject
> > >
> > > Hi,
> > >
> > > currently the the Sling Models documentation is a bit confusing; the
> > > examples show only the use of the "@Inject" annotation, while more
> > > down (at
> > > [1]) in an not obvious location the use of @Inject is discouraged.
> > > Also, when I benchmarked the use of Sling Models with different
> > > annotations [2] I found that in some situations @Inject can have a
> > > huge performance penalty compared to the injector-specfic
> > > annotations, so I would also argue from this perspective, that we
> > > should heavily discourage the use of @Inject.
> > >
> > > But at the top we state as one of the design goals of Sling Models
> > > to use standard annotations (which are mostly discouraged at [1] in
> > > favor of custom annotations).
> > >
> > > In the context of SLING-11711 I plan to  rework the documentaiton
> > > and
> > all
> > > examples to use injector-specific annotations, remove the design
> > > goal of standard annotations, and mention the discouraged
> > > annotations only in a separate section as discouraged (not
> deprecated!).
> > >
> > > WDYT?
> > >
> > > Jörg
> > >
> > >
> > > [0] https://sling.apache.org/documentation/bundles/models.html
> > > [1]
> > > https://sling.apache.org/documentation/bundles/models.html#hints-1
> > > [2] https://cqdump.joerghoh.de/2022/11/28/sling-model-performance/
> > > [3] https://issues.apache.org/jira/browse/SLING-11711
> > > --
> > > Cheers,
> > > Jörg Hoh,
> > >
> > > https://cqdump.joerghoh.de
> > > Twitter: @joerghoh
> >
> 
> 
> --
> Cheers,
> Jörg Hoh,
> 
> https://cqdump.joerghoh.de
> Twitter: @joerghoh


Re: [Sling Models documentation] discourage the use of @Inject

2022-12-17 Thread Jörg Hoh
I just pushed a first draft into
https://raw.githubusercontent.com/apache/sling-site/SLING-11711-update-slingmodels-doc/src/main/jbake/content/documentation/bundles/models.md

I moved over to the injector-specific annotations and moved the discouraged
one to the bottom. On top I restructured the documentation in a way to have
the most relevant informations on the top, moving specialized topics to the
bottom.

I struggle a bit with the documentation of the replacements of the @Via
annotation. Can you someone point me to me some example code showing how it
can be done with the injector-specific annotations?

(Unfortunately the test code in the sling-models bundle is still using
@Inject and friends, and we should eventually port them over to use the
injector-specific annotations as well.)

Jörg



Am Do., 8. Dez. 2022 um 10:45 Uhr schrieb Stefan Seifert
:

> +1
>
> using @Inject is not only a performance problem, it also may lead to
> unexpected results if an injector steps in you are not aware of.
>
> stefan
>
> > -Original Message-
> > From: Jörg Hoh 
> > Sent: Thursday, December 8, 2022 10:25 AM
> > To: Sling Developers List 
> > Subject: [Sling Models documentation] discourage the use of @Inject
> >
> > Hi,
> >
> > currently the the Sling Models documentation is a bit confusing; the
> > examples show only the use of the "@Inject" annotation, while more down
> > (at
> > [1]) in an not obvious location the use of @Inject is discouraged.
> > Also, when I benchmarked the use of Sling Models with different
> > annotations [2] I found that in some situations @Inject can have a huge
> > performance penalty compared to the injector-specfic annotations, so I
> > would also argue from this perspective, that we should heavily discourage
> > the use of @Inject.
> >
> > But at the top we state as one of the design goals of Sling Models to use
> > standard annotations (which are mostly discouraged at [1] in favor of
> > custom annotations).
> >
> > In the context of SLING-11711 I plan to  rework the documentaiton and
> all
> > examples to use injector-specific annotations, remove the design goal of
> > standard annotations, and mention the discouraged annotations only in a
> > separate section as discouraged (not deprecated!).
> >
> > WDYT?
> >
> > Jörg
> >
> >
> > [0] https://sling.apache.org/documentation/bundles/models.html
> > [1] https://sling.apache.org/documentation/bundles/models.html#hints-1
> > [2] https://cqdump.joerghoh.de/2022/11/28/sling-model-performance/
> > [3] https://issues.apache.org/jira/browse/SLING-11711
> > --
> > Cheers,
> > Jörg Hoh,
> >
> > https://cqdump.joerghoh.de
> > Twitter: @joerghoh
>


-- 
Cheers,
Jörg Hoh,

https://cqdump.joerghoh.de
Twitter: @joerghoh


RE: [Sling Models documentation] discourage the use of @Inject

2022-12-08 Thread Stefan Seifert
+1

using @Inject is not only a performance problem, it also may lead to unexpected 
results if an injector steps in you are not aware of.

stefan

> -Original Message-
> From: Jörg Hoh 
> Sent: Thursday, December 8, 2022 10:25 AM
> To: Sling Developers List 
> Subject: [Sling Models documentation] discourage the use of @Inject
> 
> Hi,
> 
> currently the the Sling Models documentation is a bit confusing; the
> examples show only the use of the "@Inject" annotation, while more down
> (at
> [1]) in an not obvious location the use of @Inject is discouraged.
> Also, when I benchmarked the use of Sling Models with different
> annotations [2] I found that in some situations @Inject can have a huge
> performance penalty compared to the injector-specfic annotations, so I
> would also argue from this perspective, that we should heavily discourage
> the use of @Inject.
> 
> But at the top we state as one of the design goals of Sling Models to use
> standard annotations (which are mostly discouraged at [1] in favor of
> custom annotations).
> 
> In the context of SLING-11711 I plan to  rework the documentaiton and  all
> examples to use injector-specific annotations, remove the design goal of
> standard annotations, and mention the discouraged annotations only in a
> separate section as discouraged (not deprecated!).
> 
> WDYT?
> 
> Jörg
> 
> 
> [0] https://sling.apache.org/documentation/bundles/models.html
> [1] https://sling.apache.org/documentation/bundles/models.html#hints-1
> [2] https://cqdump.joerghoh.de/2022/11/28/sling-model-performance/
> [3] https://issues.apache.org/jira/browse/SLING-11711
> --
> Cheers,
> Jörg Hoh,
> 
> https://cqdump.joerghoh.de
> Twitter: @joerghoh


[Sling Models documentation] discourage the use of @Inject

2022-12-08 Thread Jörg Hoh
Hi,

currently the the Sling Models documentation is a bit confusing; the
examples show only the use of the "@Inject" annotation, while more down (at
[1]) in an not obvious location the use of @Inject is discouraged.
Also, when I benchmarked the use of Sling Models with different annotations
[2] I found that in some situations @Inject can have a huge performance
penalty compared to the injector-specfic annotations, so I would also argue
from this perspective, that we should heavily discourage the use of @Inject.

But at the top we state as one of the design goals of Sling Models to use
standard annotations (which are mostly discouraged at [1] in favor of
custom annotations).

In the context of SLING-11711 I plan to  rework the documentaiton and  all
examples to use injector-specific annotations, remove the design goal of
standard annotations, and mention the discouraged annotations only in a
separate section as discouraged (not deprecated!).

WDYT?

Jörg


[0] https://sling.apache.org/documentation/bundles/models.html
[1] https://sling.apache.org/documentation/bundles/models.html#hints-1
[2] https://cqdump.joerghoh.de/2022/11/28/sling-model-performance/
[3] https://issues.apache.org/jira/browse/SLING-11711
-- 
Cheers,
Jörg Hoh,

https://cqdump.joerghoh.de
Twitter: @joerghoh