Question about conversation.begin if transient

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about conversation.begin if transient

Adrian Gonzalez
Hello,

This question has surely already been asked, but I'm looking over and over the following code :
        if (conversation.isTransient()) {
            conversation.begin();
        }

Is it possible to create a single method in Conversation class to handle this ?
Something like conversation.beginIfTransient() ? (of course with a better name :) ).

WDYT ?


_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question about conversation.begin if transient

Pete Muir
Administrator
I don't personally see much wrong with the code snippet today, it seems pretty clear…

On 15 Dec 2011, at 16:24, Adrian Gonzalez wrote:

> Hello,
>
> This question has surely already been asked, but I'm looking over and over the following code :
>         if (conversation.isTransient()) {
>             conversation.begin();
>         }
>
> Is it possible to create a single method in Conversation class to handle this ?
> Something like conversation.beginIfTransient() ? (of course with a better name :) ).
>
> WDYT ?
>
>
> _______________________________________________
> cdi-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/cdi-dev


_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev
Reply | Threaded
Open this post in threaded view
|

Re : Question about conversation.begin if transient

Adrian Gonzalez
Hi Pete, 
It just seems to me this 2 line code snippet is written so often, it would benefit to be a one code liner.



De : Pete Muir <[hidden email]>
À : Adrian Gonzalez <[hidden email]>
Cc : "[hidden email]" <[hidden email]>
Envoyé le : Vendredi 16 Décembre 2011 12h05
Objet : Re: [cdi-dev] Question about conversation.begin if transient

I don't personally see much wrong with the code snippet today, it seems pretty clear…

On 15 Dec 2011, at 16:24, Adrian Gonzalez wrote:

> Hello,
>
> This question has surely already been asked, but I'm looking over and over the following code :
>        if (conversation.isTransient()) {
>            conversation.begin();
>        }
>
> Is it possible to create a single method in Conversation class to handle this ?
> Something like conversation.beginIfTransient() ? (of course with a better name :) ).
>
> WDYT ?
>
>
> _______________________________________________
> cdi-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/cdi-dev




_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question about conversation.begin if transient

Pete Muir
Administrator
Anyone else feel strongly about this?

On 18 Dec 2011, at 17:11, Adrian Gonzalez wrote:

> Hi Pete,
> It just seems to me this 2 line code snippet is written so often, it would benefit to be a one code liner.
>
>
> De : Pete Muir <[hidden email]>
> À : Adrian Gonzalez <[hidden email]>
> Cc : "[hidden email]" <[hidden email]>
> Envoyé le : Vendredi 16 Décembre 2011 12h05
> Objet : Re: [cdi-dev] Question about conversation.begin if transient
>
> I don't personally see much wrong with the code snippet today, it seems pretty clear…
>
> On 15 Dec 2011, at 16:24, Adrian Gonzalez wrote:
>
> > Hello,
> >
> > This question has surely already been asked, but I'm looking over and over the following code :
> >        if (conversation.isTransient()) {
> >            conversation.begin();
> >        }
> >
> > Is it possible to create a single method in Conversation class to handle this ?
> > Something like conversation.beginIfTransient() ? (of course with a better name :) ).
> >
> > WDYT ?
> >
> >
> > _______________________________________________
> > cdi-dev mailing list
> > [hidden email]
> > https://lists.jboss.org/mailman/listinfo/cdi-dev
>
>
>


_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question about conversation.begin if transient

Mark Struberg
not using the CDI Conversations at all anymore. But when I did it was pretty verbose. And the isTransient() check is not the only thing a user must do. Thus once we start adding one convenience method, we will soon end up with tens of them...

just my humble opinion


LieGrue,
strub



----- Original Message -----

> From: Pete Muir <[hidden email]>
> To: Adrian Gonzalez <[hidden email]>
> Cc: "[hidden email]" <[hidden email]>
> Sent: Monday, December 19, 2011 10:13 AM
> Subject: Re: [cdi-dev] Question about conversation.begin if transient
>
> Anyone else feel strongly about this?
>
> On 18 Dec 2011, at 17:11, Adrian Gonzalez wrote:
>
>>  Hi Pete,
>>  It just seems to me this 2 line code snippet is written so often, it would
> benefit to be a one code liner.
>>
>>
>>  De : Pete Muir <[hidden email]>
>>  À : Adrian Gonzalez <[hidden email]>
>>  Cc : "[hidden email]" <[hidden email]>
>>  Envoyé le : Vendredi 16 Décembre 2011 12h05
>>  Objet : Re: [cdi-dev] Question about conversation.begin if transient
>>
>>  I don't personally see much wrong with the code snippet today, it seems
> pretty clear…
>>
>>  On 15 Dec 2011, at 16:24, Adrian Gonzalez wrote:
>>
>>  > Hello,
>>  >
>>  > This question has surely already been asked, but I'm looking over
> and over the following code :
>>  >        if (conversation.isTransient()) {
>>  >            conversation.begin();
>>  >        }
>>  >
>>  > Is it possible to create a single method in Conversation class to
> handle this ?
>>  > Something like conversation.beginIfTransient() ? (of course with a
> better name :) ).
>>  >
>>  > WDYT ?
>>  >
>>  >
>>  > _______________________________________________
>>  > cdi-dev mailing list
>>  > [hidden email]
>>  > https://lists.jboss.org/mailman/listinfo/cdi-dev
>>
>>
>>
>
>
> _______________________________________________
> cdi-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev
Reply | Threaded
Open this post in threaded view
|

Re : Question about conversation.begin if transient

Adrian Gonzalez
> Thus once we start adding one convenience method, we will soon end up with tens of them...


Youps... good point, didn't though about this. I should use CDI quite a bit more.

I think this closes this thread ;)

Thanks !
________________________________

De : Mark Struberg <[hidden email]>
À : Pete Muir <[hidden email]>
Cc : cdi-dev <[hidden email]>
Envoyé le : Lundi 19 Décembre 2011 10h53
Objet : Re: [cdi-dev] Question about conversation.begin if transient

not using the CDI Conversations at all anymore. But when I did it was pretty verbose. And the isTransient() check is not the only thing a user must do. Thus once we start adding one convenience method, we will soon end up with tens of them...

just my humble opinion


LieGrue,
strub



----- Original Message -----

> From: Pete Muir <[hidden email]>
> To: Adrian Gonzalez <[hidden email]>
> Cc: "[hidden email]" <[hidden email]>
> Sent: Monday, December 19, 2011 10:13 AM
> Subject: Re: [cdi-dev] Question about conversation.begin if transient
>
> Anyone else feel strongly about this?
>
> On 18 Dec 2011, at 17:11, Adrian Gonzalez wrote:
>
>>  Hi Pete,
>>  It just seems to me this 2 line code snippet is written so often, it would
> benefit to be a one code liner.
>>
>>
>>  De : Pete Muir <[hidden email]>
>>  À : Adrian Gonzalez <[hidden email]>
>>  Cc : "[hidden email]" <[hidden email]>
>>  Envoyé le : Vendredi 16 Décembre 2011 12h05
>>  Objet : Re: [cdi-dev] Question about conversation.begin if transient
>>
>>  I don't personally see much wrong with the code snippet today, it seems
> pretty clear…
>>
>>  On 15 Dec 2011, at 16:24, Adrian Gonzalez wrote:
>>
>>  > Hello,
>>  >
>>  > This question has surely already been asked, but I'm looking over
> and over the following code :
>>  >        if (conversation.isTransient()) {
>>  >            conversation.begin();
>>  >        }
>>  >
>>  > Is it possible to create a single method in Conversation class to
> handle this ?
>>  > Something like conversation.beginIfTransient() ? (of course with a
> better name :) ).
>>  >
>>  > WDYT ?
>>  >
>>  >
>>  > _______________________________________________
>>  > cdi-dev mailing list
>>  > [hidden email]
>>  > https://lists.jboss.org/mailman/listinfo/cdi-dev
>>
>>
>>
>
>
> _______________________________________________
> cdi-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev