Fully agree with Pete's assessment.
Unless the (still very experimental and not even used by Co Spec Lead Oracle anywhere in Java 8;-) new type annotations that are at least in theory available from Java SE 8 onward were applied, objects are always mutable

Werner


On Tue, Dec 16, 2014 at 7:21 PM, <cdi-dev-request@lists.jboss.org> wrote:
Send cdi-dev mailing list submissions to
        cdi-dev@lists.jboss.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.jboss.org/mailman/listinfo/cdi-dev
or, via email, send a message with subject or body 'help' to
        cdi-dev-request@lists.jboss.org

You can reach the person managing the list at
        cdi-dev-owner@lists.jboss.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of cdi-dev digest..."


Today's Topics:

   1. Is the concept of mutable event payload specified
      (Antoine Sabot-Durand)
   2. Re: Is the concept of mutable event payload specified
      (John D. Ament)
   3. Re: Is the concept of mutable event payload specified (Pete Muir)
   4. Re: Is the concept of mutable event payload specified
      (Romain Manni-Bucau)
   5. Re: Is the concept of mutable event payload specified
      (Thorben Janssen)


----------------------------------------------------------------------

Message: 1
Date: Tue, 16 Dec 2014 17:31:32 +0100
From: Antoine Sabot-Durand <antoine@sabot-durand.net>
Subject: [cdi-dev] Is the concept of mutable event payload specified
To: cdi-dev <cdi-dev@lists.jboss.org>
Message-ID: <213B41E0-D73F-4CED-95B0-AFB50451B791@sabot-durand.net>
Content-Type: text/plain; charset="utf-8"

Hi guys,


Always working on Async event concept and discussion around mutable payloads. I was looking where in the spec we specified the fact that fired payload are mutable. I red-read chapter 10  (http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#events <http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#events>) twice and didn?t found. I also browsed JIRA and TCK to find any ref to this feature and found nothing. On the other hand it is not specified that payload should be immutable ;)

I?d be happy if some of you could have a look and see if I missed something.

If I?m not wrong, the mutable payload we (including myself) advertise in CDI is a non portable feature (I?m the firs surprised here). So I propose that :

1) We decide to write something in the specification about allowing or forbidding it (I know some people not happy with this mix between observer and visitor pattern)
1bis) Should we decide to forbid it by default, we should provide an alternative mode to allow people using this unspecified feature
2) Forbid it for fireAsync()


Thanks for your feedback and your correction if I missed the feature in the spec.

Antoine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20141216/6aef8552/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20141216/6aef8552/attachment-0001.bin

------------------------------

Message: 2
Date: Tue, 16 Dec 2014 16:44:37 +0000
From: "John D. Ament" <john.d.ament@gmail.com>
Subject: Re: [cdi-dev] Is the concept of mutable event payload
        specified
To: Antoine Sabot-Durand <antoine@sabot-durand.net>,    cdi-dev
        <cdi-dev@lists.jboss.org>
Message-ID:
        <CAOqetn_YKLsDMC9Rp=DVAUYPoaRoAm_Edp31-nXQM9r8rhVQ4w@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

What's the issue w/ fire async and mutable payload?  Non-deterministic
behavior depending on thread?

On Tue Dec 16 2014 at 11:32:53 AM Antoine Sabot-Durand <
antoine@sabot-durand.net> wrote:

> Hi guys,
>
>
> Always working on Async event concept and discussion around mutable
> payloads. I was looking where in the spec we specified the fact that fired
> payload are mutable. I red-read chapter 10  (
> http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#events) twice and didn?t
> found. I also browsed JIRA and TCK to find any ref to this feature and
> found nothing. On the other hand it is not specified that payload should be
> immutable ;)
>
> I?d be happy if some of you could have a look and see if I missed
> something.
>
> If I?m not wrong, the mutable payload we (including myself) advertise in
> CDI is a non portable feature (I?m the firs surprised here). So I propose
> that :
>
> 1) We decide to write something in the specification about allowing or
> forbidding it (I know some people not happy with this mix between observer
> and visitor pattern)
> 1bis) Should we decide to forbid it by default, we should provide an
> alternative mode to allow people using this unspecified feature
> 2) Forbid it for fireAsync()
>
>
> Thanks for your feedback and your correction if I missed the feature in
> the spec.
>
> Antoine
> _______________________________________________
> cdi-dev mailing list
> cdi-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (http://www.apache.org/
> licenses/LICENSE-2.0.html). For all other ideas provided on this list,
> the provider waives all patent and other intellectual property rights
> inherent in such information.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20141216/81b4a0a5/attachment-0001.html

------------------------------

Message: 3
Date: Tue, 16 Dec 2014 17:39:19 +0000
From: Pete Muir <pmuir@redhat.com>
Subject: Re: [cdi-dev] Is the concept of mutable event payload
        specified
To: Antoine Sabot-Durand <antoine@sabot-durand.net>
Cc: cdi-dev <cdi-dev@lists.jboss.org>
Message-ID: <E83F9043-AB42-45A8-B9DC-9853685F761B@redhat.com>
Content-Type: text/plain; charset="utf-8"

I don?t think it?s specified. As objects are, by default in Java, mutable, I would assume that payloads are implicitly mutable.

> On 16 Dec 2014, at 16:31, Antoine Sabot-Durand <antoine@sabot-durand.net> wrote:
>
> Hi guys,
>
>
> Always working on Async event concept and discussion around mutable payloads. I was looking where in the spec we specified the fact that fired payload are mutable. I red-read chapter 10  (http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#events <http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#events>) twice and didn?t found. I also browsed JIRA and TCK to find any ref to this feature and found nothing. On the other hand it is not specified that payload should be immutable ;)
>
> I?d be happy if some of you could have a look and see if I missed something.
>
> If I?m not wrong, the mutable payload we (including myself) advertise in CDI is a non portable feature (I?m the firs surprised here). So I propose that :
>
> 1) We decide to write something in the specification about allowing or forbidding it (I know some people not happy with this mix between observer and visitor pattern)
> 1bis) Should we decide to forbid it by default, we should provide an alternative mode to allow people using this unspecified feature
> 2) Forbid it for fireAsync()
>
>
> Thanks for your feedback and your correction if I missed the feature in the spec.
>
> Antoine
> _______________________________________________
> cdi-dev mailing list
> cdi-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20141216/00b88212/attachment-0001.html

------------------------------

Message: 4
Date: Tue, 16 Dec 2014 18:46:50 +0100
From: Romain Manni-Bucau <rmannibucau@gmail.com>
Subject: Re: [cdi-dev] Is the concept of mutable event payload
        specified
To: Pete Muir <pmuir@redhat.com>
Cc: cdi-dev <cdi-dev@lists.jboss.org>
Message-ID:
        <CACLE=7PfznX0Qq6HbkUdh999NRBFYgLRcapNBLKn=wOmPEO9Xw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi Antoine,

why isn't it portable?


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-12-16 18:39 GMT+01:00 Pete Muir <pmuir@redhat.com>:
> I don?t think it?s specified. As objects are, by default in Java, mutable, I
> would assume that payloads are implicitly mutable.
>
> On 16 Dec 2014, at 16:31, Antoine Sabot-Durand <antoine@sabot-durand.net>
> wrote:
>
> Hi guys,
>
>
> Always working on Async event concept and discussion around mutable
> payloads. I was looking where in the spec we specified the fact that fired
> payload are mutable. I red-read chapter 10
> (http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#events) twice and didn?t
> found. I also browsed JIRA and TCK to find any ref to this feature and found
> nothing. On the other hand it is not specified that payload should be
> immutable ;)
>
> I?d be happy if some of you could have a look and see if I missed something.
>
> If I?m not wrong, the mutable payload we (including myself) advertise in CDI
> is a non portable feature (I?m the firs surprised here). So I propose that :
>
> 1) We decide to write something in the specification about allowing or
> forbidding it (I know some people not happy with this mix between observer
> and visitor pattern)
> 1bis) Should we decide to forbid it by default, we should provide an
> alternative mode to allow people using this unspecified feature
> 2) Forbid it for fireAsync()
>
>
> Thanks for your feedback and your correction if I missed the feature in the
> spec.
>
> Antoine
> _______________________________________________
> cdi-dev mailing list
> cdi-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the code
> under the Apache License, Version 2
> (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other intellectual
> property rights inherent in such information.
>
>
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the code
> under the Apache License, Version 2
> (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other intellectual
> property rights inherent in such information.



------------------------------

Message: 5
Date: Tue, 16 Dec 2014 19:21:48 +0100
From: Thorben Janssen <thjanssen123@gmail.com>
Subject: Re: [cdi-dev] Is the concept of mutable event payload
        specified
To: cdi-dev <cdi-dev@lists.jboss.org>
Message-ID:
        <CAE9nDy-o=PHg++iQ4vr8ymEm0eH0zEabbHLWf7U-_cX_zBmZYQ@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

We should be careful with making the payload imutable. I know of several
applications (and companies) that change the payload to send some
information back to to the event producer.
We shouldn't break these apps, if we can solve it in a different way.

--
*Thorben Janssen*

@thjanssen123 <https://twitter.com/thjanssen123>
www.thoughts-on-java.org

2014-12-16 18:46 GMT+01:00 Romain Manni-Bucau <rmannibucau@gmail.com>:
>
> Hi Antoine,
>
> why isn't it portable?
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
> 2014-12-16 18:39 GMT+01:00 Pete Muir <pmuir@redhat.com>:
> > I don?t think it?s specified. As objects are, by default in Java,
> mutable, I
> > would assume that payloads are implicitly mutable.
> >
> > On 16 Dec 2014, at 16:31, Antoine Sabot-Durand <antoine@sabot-durand.net
> >
> > wrote:
> >
> > Hi guys,
> >
> >
> > Always working on Async event concept and discussion around mutable
> > payloads. I was looking where in the spec we specified the fact that
> fired
> > payload are mutable. I red-read chapter 10
> > (http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#events) twice and
> didn?t
> > found. I also browsed JIRA and TCK to find any ref to this feature and
> found
> > nothing. On the other hand it is not specified that payload should be
> > immutable ;)
> >
> > I?d be happy if some of you could have a look and see if I missed
> something.
> >
> > If I?m not wrong, the mutable payload we (including myself) advertise in
> CDI
> > is a non portable feature (I?m the firs surprised here). So I propose
> that :
> >
> > 1) We decide to write something in the specification about allowing or
> > forbidding it (I know some people not happy with this mix between
> observer
> > and visitor pattern)
> > 1bis) Should we decide to forbid it by default, we should provide an
> > alternative mode to allow people using this unspecified feature
> > 2) Forbid it for fireAsync()
> >
> >
> > Thanks for your feedback and your correction if I missed the feature in
> the
> > spec.
> >
> > Antoine
> > _______________________________________________
> > cdi-dev mailing list
> > cdi-dev@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/cdi-dev
> >
> > Note that for all code provided on this list, the provider licenses the
> code
> > under the Apache License, Version 2
> > (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> > provided on this list, the provider waives all patent and other
> intellectual
> > property rights inherent in such information.
> >
> >
> >
> > _______________________________________________
> > cdi-dev mailing list
> > cdi-dev@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/cdi-dev
> >
> > Note that for all code provided on this list, the provider licenses the
> code
> > under the Apache License, Version 2
> > (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> > provided on this list, the provider waives all patent and other
> intellectual
> > property rights inherent in such information.
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other
> intellectual property rights inherent in such information.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20141216/f74fbdb4/attachment.html

------------------------------

_______________________________________________
cdi-dev mailing list
cdi-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html).  For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.

End of cdi-dev Digest, Vol 49, Issue 13
***************************************