jakartaee / data

Data-API
Apache License 2.0
105 stars 29 forks source link

Define basic terms: "entity", "repository", "identifier", etc. #244

Closed gavinking closed 1 year ago

gavinking commented 1 year ago

A challenge this spec faces is the extremely high level of abstraction. At this level of abstraction we can't be sure that we all mean the same things by the words we use. There's a risk of accidentally smuggling the semantics of one sort of data storage technology into the specification without even realizing it.

To make a start on nailing down the meaning of words here, I propose the following starting point. Please let me know what you think.

Entities and repositories

Abstractly, an entity (or entity type) is a schema for data. Here we assume that data is persistent, that is, that the data outlives any Java process which makes use of it.

When there's no risk of confusion, we will often use the word “entity” to mean the entity class, or even an instance of the entity class.

A repository is a Java interface which acts as a gateway for access to persistent data of one or more entity types.

Jakarta Data allows the developer to define:

Then an implementation of Jakarta Data which targets the same data store is responsible for providing an implementation of each repository interface.

otaviojava commented 1 year ago

Thank you.

I've proposed a PR based on what you said here and merged it with what we already had in our documentation.

Please, let me know your thoughts:

https://github.com/jakartaee/data/pull/245

njr-11 commented 1 year ago

Thank you.

I've proposed a PR based on what you said here and merged it with what we already had in our documentation.

Please, let me know your thoughts:

245

Thanks for contributing this. It looks great. I added a few comments no Otavio's pull, which are more related to some things he may have replaced/reworded when adding this in rather than the content as written within this issue. I do want to be careful when contributing other participants' ideas on their behalf. The best approach would be for Gavin to have created the pull with his own contributions in it. Otavio - please check that Gavin is okay with you authoring the pull with your take on his contributions within it rather than him doing so directly.

otaviojava commented 1 year ago

Thanks for the contribution; I'll close it. If you have any further points, please open the issue again or open another one.