Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97082 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36478 invoked from network); 20 Nov 2016 10:20:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2016 10:20:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=marijic.silvio@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marijic.silvio@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.172 as permitted sender) X-PHP-List-Original-Sender: marijic.silvio@gmail.com X-Host-Fingerprint: 209.85.223.172 mail-io0-f172.google.com Received: from [209.85.223.172] ([209.85.223.172:35080] helo=mail-io0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/00-35942-FC871385 for ; Sun, 20 Nov 2016 05:19:59 -0500 Received: by mail-io0-f172.google.com with SMTP id n13so18743123ioe.2 for ; Sun, 20 Nov 2016 02:19:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vBxvtE3uh7tvymKK75gs6duSu/WEyMjfulXLq1jt+Rg=; b=oIiUvyfmrwwhzUWguedU/pT0w/DlMCBWiLyxtmeNZnYyADFm8+xIgMcdKZI4Wjz+qn zHauzRX59U6mSCBJWfUCzq3AoQgTiVskySPsIa5QOUWSBA0o4DRidzdrs2jsita5FykX yKYkeBCcLxrik52KJ05z15IKfynvFM9bHVheZdBDzPhH0pWoWgHJXCr7G07lHzCauDeW 6eW7Swf2msgsObj3EcL040OTspIt4bv8BRIEhrgPE3tpaLdENa3u2jb+bC3cfLE1rbai omvfq16RGq3r457nAYXRJHJk8B3PCb4E+j+uvXwM/3xMeUeqp2fZVJ/bJcldDBMs0jU6 h8sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vBxvtE3uh7tvymKK75gs6duSu/WEyMjfulXLq1jt+Rg=; b=WEd33D+u6NdI0WfKKCNOKw5pa/s5SwmvSsmcpmqa3SUw6SONle35e2B0iG3KVlWpfU uICoWtWSKrogESAnvQLxNnLuvfqHYCC6He7VUy36LTqxUKaAWzoVdT+tKsBUmb6M1A0J /jWXjx8HLurw2I3s4hwkgkShgXWVAkq1ppJc6znjwcrsDqu3kz2SaPd0vid+gNT1Mrwj dxbz9mC6IVm0mr/5kazdaXi/d/RIVZlgqfTpgwCPSKqfUTjb6SQf16oJt+30bhDXlLKA SHMSw+Y94/CaNL3I9ebzedmWMDfQLy8RTx54/Zppb1U9Ir9+aLRoy8Nhc0FomgeV7S8U IAPA== X-Gm-Message-State: AKaTC00sIiuDJXwus7697fQwWgTNcPst0Xgu0zUhxSMUf38SQYK5tcqn64mn2DpY4dgH5Vg9kJ+Py6/rg3kJOQ== X-Received: by 10.107.183.148 with SMTP id h142mr6454093iof.190.1479637196627; Sun, 20 Nov 2016 02:19:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.63.202 with HTTP; Sun, 20 Nov 2016 02:19:55 -0800 (PST) Received: by 10.36.63.202 with HTTP; Sun, 20 Nov 2016 02:19:55 -0800 (PST) In-Reply-To: <30925bc7-acb7-e06b-f1bd-aa7b67f07a95@garfieldtech.com> References: <3D1B1C03-6453-4368-8318-29FDB5240845@gmail.com> <30925bc7-acb7-e06b-f1bd-aa7b67f07a95@garfieldtech.com> Date: Sun, 20 Nov 2016 11:19:55 +0100 Message-ID: To: Larry Garfield Cc: PHP Internals List Content-Type: multipart/alternative; boundary=94eb2c0b8e6e80628a0541b8e1a5 Subject: Re: [PHP-DEV] Immutability RFC From: marijic.silvio@gmail.com (=?UTF-8?Q?Silvio_Mariji=C4=87?=) --94eb2c0b8e6e80628a0541b8e1a5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable @Larry, I see your point, but when I said 'identity', I was thinking about referential identity, not wether that object has identity in the user application. Cheers On Nov 19, 2016 7:15 PM, "Larry Garfield" wrote: > I'm not Paul, but... > > If you have a data storage system using CRAP (Create Read Archive Purge) > instead of CRUD, or EventSourcing, or any other system that needs to > maintain history, then you need stored objects that have identities > (document abc revision 123, for instance) so you can reference them. In > order to maintain history, however, when you load that data into a classe= d > object you do NOT want that object to be mutable, because there is, by > design, no way to "update" that object in place in storage. Rather, you'= d > want to have a special "new object" class that is mutable, persist that t= o > storage, and then on load of historical data you want a read-only object = to > expose to application code. That object will still have an identity, > however. > > I'm actually working on such a library on the side right now. > > --Larry Garfield > > On 11/16/2016 11:57 AM, Silvio Mariji=C4=87 wrote: > >> @Paul, >> I understand that immutable doesn't automatically apply value object. Ca= n >> you give us some examples where immutable object should have identity? >> >> Cheers >> On Nov 16, 2016 4:48 PM, "Paul Jones" wrote: >> >> On Nov 16, 2016, at 07:57, Silvio Mariji=C4=87 >>>> >>> wrote: >>> >>>> Hi, >>>> >>>> To anyone who is interested in this RFC. What do you think what behavo= ur >>>> >>> we >>> >>>> should have when you try to compare two immutable objects by identity >>>> >>> like >>> >>>> this: >>>> >>> I don't mean to be overly-nitpicky here, but it strikes me that the iss= ue >>> might not be "immutable object" so much as "value object." >>> >>> That is, an immutable object (or at least a read-only object) might ver= y >>> well have an identity. But a *value* object, in addition to read-only = or >>> immutable, would have no identity proper. >>> >>> Maybe using the alternative term (if it applies) would help to clarify >>> the >>> situation. >>> >>> >>> -- >>> Paul M. Jones >>> pmjones88@gmail.com >>> http://paul-m-jones.com >>> >>> Modernizing Legacy Applications in PHP >>> https://leanpub.com/mlaphp >>> >>> Solving the N+1 Problem in PHP >>> https://leanpub.com/sn1php >>> >>> >>> >>> >>> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --94eb2c0b8e6e80628a0541b8e1a5--