Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to document generics in commons-data #35

Open
ngonzalezpazFC opened this issue Jul 8, 2021 · 1 comment
Open

How to document generics in commons-data #35

ngonzalezpazFC opened this issue Jul 8, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@ngonzalezpazFC
Copy link
Contributor

Interfaces in commons data have 2 parameters. Those should be the persistece layer entity and the type of its identifier.
In interfaces like JpaDaoSupport or ConversionJpaDaoSupport, that implements CrudDao, the entity type parameter is replaced by the bussiness entity, because a conversion between business and persistence entities is made.
How should commons-data interface entity type be documented? As the persistence or business layer entity? Or should the difference be explained in the interfaces that do conversions? (ConversionJpaDaoSupport or JpaDaoSupport)

@javier-godoy
Copy link
Member

javier-godoy commented Jul 8, 2021

CreationDao<T, K> T is the type of the entity.

CrudDao<T, K>extends CreationDao<T, K> ... T is the type of the entity.

ConversionJpaDaoSupport<S, T extends Identifiable<K>, K extends Serializable>

T is the type of persistent entity
S is the type of the service entity

JpaDaoSupport<T extends Identifiable<K>, K extends Serializable>
		extends ConversionJpaDaoSupport<T, T, K> 

T is the type of the entity.

Then in a package-level documentation we will document how "the entity" maps to S and T in different architectures.

@mlopezFC mlopezFC added the question Further information is requested label Aug 29, 2022
@mlopezFC mlopezFC added the documentation Improvements or additions to documentation label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants