Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E6882200BA7 for ; Fri, 21 Oct 2016 19:07:17 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E383E160AE8; Fri, 21 Oct 2016 17:07:17 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3881A160ADE for ; Fri, 21 Oct 2016 19:07:17 +0200 (CEST) Received: (qmail 88925 invoked by uid 500); 21 Oct 2016 17:07:16 -0000 Mailing-List: contact dev-help@zest.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zest.apache.org Delivered-To: mailing list dev@zest.apache.org Received: (qmail 88913 invoked by uid 99); 21 Oct 2016 17:07:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2016 17:07:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id BBF72C05BF for ; Fri, 21 Oct 2016 17:07:15 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.28 X-Spam-Level: ** X-Spam-Status: No, score=2.28 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Aa_0W72cbmaK for ; Fri, 21 Oct 2016 17:07:14 +0000 (UTC) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 054415FBF0 for ; Fri, 21 Oct 2016 17:07:13 +0000 (UTC) Received: from mfilter36-d.gandi.net (mfilter36-d.gandi.net [217.70.178.167]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 9671017209B for ; Fri, 21 Oct 2016 19:07:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter36-d.gandi.net Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter36-d.gandi.net (mfilter36-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id ZURBKFhTs2Lb for ; Fri, 21 Oct 2016 19:07:06 +0200 (CEST) X-Originating-IP: 212.195.187.94 Received: from parangon.local (bne75-h07-212-195-187-94.dsl.sta.abo.bbox.fr [212.195.187.94]) (Authenticated sender: paul@nosphere.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id C91201720A3 for ; Fri, 21 Oct 2016 19:07:05 +0200 (CEST) Message-ID: <580A4B3A.1080700@nosphere.org> Date: Fri, 21 Oct 2016 19:07:06 +0200 From: Paul Merlin User-Agent: Postbox 3.0.11 (Macintosh/20140602) MIME-Version: 1.0 To: dev@zest.apache.org Subject: Re: Design flaw in EntityStore SPI? References: In-Reply-To: X-Enigmail-Version: 1.2.3 Content-Type: multipart/alternative; boundary="------------020000010901030902070409" archived-at: Fri, 21 Oct 2016 17:07:18 -0000 --------------020000010901030902070409 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes sense to me Niclas Hedhman a écrit : > Hi again, > While looking into the feasibility of implementing a Repository EntityStore > I realized that the current SPI seems flawed. > > The TYPE of an entity is stored with the entity and not the entity type > that is being processed by the outside world. And then type lookup is used > via the current Module associated to the current UnitOfWork. > > It seems more logical to me that an EnttyDscriptor is passed down to the > EntityStore, so that the type doesn't need to be looked up. For ES, this > seems to work well, although this doesn't solve a similar issue in the > Query system. > > I would like to change the EntityStoreSPI from > > > public interface EntityStoreSPI > { > EntityState newEntityState( EntityStoreUnitOfWork unitOfWork, > EntityReference identity, > EntityDescriptor entityDescriptor > ); > > EntityState entityStateOf( EntityStoreUnitOfWork unitOfWork, > ModuleDescriptor module, > EntityReference identity ); > > String versionOf( EntityStoreUnitOfWork unitOfWork, > EntityReference identity ); > > StateCommitter applyChanges( EntityStoreUnitOfWork unitOfWork, > Iterable state ); > } > > to > > public interface EntityStoreSPI > { > EntityState newEntityState( EntityStoreUnitOfWork unitOfWork, > EntityReference identity, > EntityDescriptor entityDescriptor > ); > > EntityState entityStateOf( EntityStoreUnitOfWork unitOfWork, > EntityReference identity, > EntityDescriptor entityDescriptor ); > > String versionOf( EntityStoreUnitOfWork unitOfWork, > EntityReference identity, > EntityDescriptor entityDescriptor ); > > StateCommitter applyChanges( EntityStoreUnitOfWork unitOfWork, > Iterable state ); > } > > > which I think can handle the requirements of Repository ES more elegantly. > > WDYT? > > Cheers --------------020000010901030902070409--