Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

Repated double properties for nested entities #346

Open
jmakeig opened this issue Sep 6, 2017 · 7 comments
Open

Repated double properties for nested entities #346

jmakeig opened this issue Sep 6, 2017 · 7 comments

Comments

@jmakeig
Copy link
Contributor

jmakeig commented Sep 6, 2017

An entity with a sub-entity of type "person" where that sub-entity is also called "person" results in a duplicate name in the XML like:

<envelope>
 <person>
    <person>
     <name>bob</name>
     <age>33</age>
    </person>
  </person>
</envelope>

The extra level of indirection is particularly odd (and appears to users to be a bug) when the reference and the sub-entity have the same name, resulting in an element being doubled.

@jmakeig
Copy link
Contributor Author

jmakeig commented Sep 6, 2017

From RFE4043.

@grechaw
Copy link
Contributor

grechaw commented Sep 6, 2017

Entities have properties, and the type of a property can be an entity.

This example doesn't follow that convention. It's a different way of grouping documents, more like XML modeling.

So what is the action one might take for this issue? It's not a bug, just a statement.

The convention of entity types being Uppercase and property names being lowerCase helps to distinguish among them

@jmakeig
Copy link
Contributor Author

jmakeig commented Sep 7, 2017

I’m not sure I understand the original issue or your analysis, @grechaw. @damonfeldman can you please weigh in?

@grechaw
Copy link
Contributor

grechaw commented Sep 7, 2017

Let me put it this way-- what model created this envelope? As is, entity services cannot make it. The original issue Michael Doane came up with had a notion of an entity ( ~element) which contains other entities. Containment or 'sub-entities' is not something that entity services does at this time.

@damonfeldman
Copy link

This may be data from an augmentation in the data hub framework. Perhaps @paxtonhare can weigh in. I would say this is an RFE around having ES specify documents with a particular structure. If I understand correctly, a feature for nested entities is planned already?

@jmakeig
Copy link
Contributor Author

jmakeig commented Sep 22, 2017

Yes, #266 describes sub-entities. We should also think about serialization strategies, such as which (and how) to denormalize related entities (or even sub-entities) or how to handle elements vs. attributes, one-to-many (e.g. pluralized parent element in XML, Array wrappers on single items in JSON, etc.). What else?

I don’t want to give too much artistic license on serialization. If done correctly, long-term, the physical structures are mostly implementation details. The high-order bit is the instance of the model, not how it’s represented in a document.

@sparnell
Copy link

If I'm following this discussion correctly, it seems that the position is that there's no way to express an entity with a sub-entity property that doesn't result in the extra level of markup when serialized to XML. If that's correct, then I'll second Justin's original comment that this is seen as a bug by users. In fact, I'm commenting on this because I was asked by a customer's developer to file a bug report against this behavior.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants