-
Notifications
You must be signed in to change notification settings - Fork 265
Remove circular dependency between entity and api schema #1990
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
base: main
Are you sure you want to change the base?
Remove circular dependency between entity and api schema #1990
Conversation
@@ -981,7 +983,7 @@ public PrincipalWithCredentials createPrincipal(PolarisEntity entity) { | |||
entity.getName()); | |||
} | |||
return new PrincipalWithCredentials( | |||
new PrincipalEntity(principalResult.getPrincipal()).asPrincipal(), | |||
toPrincipal(new PrincipalEntity(principalResult.getPrincipal())), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big fan of the static imports outside of test code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks like a good change to me. I have one doubt after reading #780 though -- is it possible to actually remove the dependency after this change? As in, the gradle dependency?
|
||
public final class EntityConverter { | ||
|
||
public static Catalog toCatalog(CatalogEntity entity) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually remove the circular dependency? The old CatalogEntity.asCatalog()
method and this method do the same thing and exist in the case package 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any circular dependency in the code base. Here is the current dependency tree
polaris-api-management-model
depends no onepolaris-core
depends onpolaris-api-management-model
polaris-api-management-service
depends onpolaris-api-management-model
andpolaris-core
.
This change is a very good step to remove the dependency of (low level) persistence concerns to (high level) API concerns, which can be, as you mentioned in the PR summary, considered a circular dependency. I do support this change. |
This pr is made to remove the direct dependency of API schema in the entity class as mentioned in #780