[
https://issues.apache.org/jira/browse/MRM-1964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16234230#comment-16234230
]
Martin Stockhammer commented on MRM-1964:
-----------------------------------------
Proposal on the mailing list:
{quote}after reading a lot of code and tickets the last days I would like to
propose some
refactoring changes:
- One change and I think good to handle would be to switch from java.io.File
to java.nio.Path for all the code.
Currently these are mixed (new code uses mostly Path) and leads to confusion
and needs always
conversions when accessing new code from old one and vice versa.
The other one is more challenging but may be implemented step by step.
- After reading the code and https://issues.apache.org/jira/browse/MRM-1704
(and dependent tickets) I
think it would make sense to separate the code that is maven specific from
the archiva interfaces / main classes.
How?
- First, there is one thing I missed: Main interfaces for a managed and
remote repository
-> the classes used are beans from the repository-admin module
-> Maybe there are other beans from repository-admin used. I think these
should be extracted to interfaces too.
-> I would put them to the "archiva-repository-layer" module, or do you
think there is a separate module necessary?
- Separate other modules like archiva-indexer into archiva and maven specific
modules
-> I would create an -api module for these and move the archiva specific
part / interfaces to the api module
Problems here:
- Can we start with a interface that represents the current
managed/remoterepository-Beans, or do we have to
find a more abstract one? (what other types of repositories may be
implemented in the future, and what do they need?)
- The maven repository model / indexes assume the content is stored in the
file system, do we need to keep this
more abstract, or make sure, that the already existing RepositoryContent
interfaces are used? Or will repositories always
have content / indexes in the filesystem?
- I'm not sure about the role/purpose of archiva-model and the code
generation. I do not know the history of this project, so
you may clarify this. Is code generation considered best practice here and
should be used more often?
Is it primarily used for configuration objects?
Olivier, you created the ticket and maybe you can tell, what you had in mind,
or tell something about what is more historic and
what is best practice.
So I'm for a pragmatic evolutionary approach. I will try to push small commits
and start with interfaces that mainly represent
what we already have. Consider my next commits to master as proposals. If you
think this goes into the wrong direction, tell me.
Greetings
Martin{quote}
> Refactor repository api
> -----------------------
>
> Key: MRM-1964
> URL: https://issues.apache.org/jira/browse/MRM-1964
> Project: Archiva
> Issue Type: Improvement
> Reporter: Martin Stockhammer
> Assignee: Martin Stockhammer
> Priority: Major
>
> Currently, the repository access managed via the repository admin api and has
> several specifics in it that are highly dependent on the repository
> implementation.
> At the time there is no way to provide another repository type without
> changing/duplicating code on a lot of different places.
> Another issue, is that many modules are dependent on maven libraries.
> Goal is to provide a central repository registry, that keeps track of
> repositories and delegates provider specific tasks to special repository
> providers.
> Maven libraries should only be used in the repository provider
> implementations. All other modules should use the central repository api.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)