polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niclas Hedhman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (POLYGENE-95) Entity = Identity + Value
Date Sun, 09 Apr 2017 23:51:41 GMT

    [ https://issues.apache.org/jira/browse/POLYGENE-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15962308#comment-15962308
] 

Niclas Hedhman commented on POLYGENE-95:
----------------------------------------

Paul suggest on mailing list that a small internal change is made for 3.0, to support the
introduction of this later;

    We can look at this one in very different ways and see small increments that can give
us some goodness without eating the whole cake. What I would like us to do quickly, and preferably

    for 3.0, is to change how Entity state is serialized in our EntityStore SPI helpers.

    Today, the "value" part of an EntityState is mixed with entity aspects:

{code:json}
{
  reference: "..",
  application_version: "..",
  type: "..",
  version: "..",
  modified: "..",
  properties: {..},
  associations: {..},
  manyassociations: {..},
  namedassociations: {..}
}
{code}

    I'm thinking about persisting entities with the following structure instead:

{code:json}
{
  identity: "..",
  application_version: "..",
  type: "..",
  version: "..",
  modified: "..",
  value: { // Exact same state (de)serialization as values
    myProperty: {..},
    myAssoc: "..",
    myManyAssoc: [..],
    myNamedAssoc: {..}
  }
}
{code}

    This is quite simple to change, simplifies a lot of code and I'm willing to push that
forward rather quickly.
    I already have a local experiment of this change.
    BUT, this is a breaking change of the storage format so before doing so I'd like to know
what do you all think.
    3.0 is a good time to do this. Don't want to wait for 4.0. If we want to push a version
out prior to that change, then it should be a -ALPHA1 instead of a -RC1.

> Entity = Identity + Value
> -------------------------
>
>                 Key: POLYGENE-95
>                 URL: https://issues.apache.org/jira/browse/POLYGENE-95
>             Project: Polygene
>          Issue Type: Sub-task
>            Reporter: Niclas Hedhman
>
> By viewing an Entity as a composite of an Immutable Identity and a single Value, we end
up with easier transactional semantics, and a generic "Merge" facility could be created.
> For Entities with a lot of properties, where only a small number change each time, we
would recommend that the static part and the dynamic part are implemented as two sub-entities,
or a main entity with all static bits and a sub-entity with the changing data.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message