You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/07/12 04:59:33 UTC
[GitHub] [shardingsphere] xuup opened a new issue, #19051: Refer to each other in class "ConnectionSession" and "BackendConnection"
xuup opened a new issue, #19051:
URL: https://github.com/apache/shardingsphere/issues/19051
## Question
Hi, I found a place refer to each other in ShardingSphere master branch.
##### org/apache/shardingsphere/proxy/backend/session/ConnectionSession.java
BackendConnection is one of ConnectionSession‘s properties.
```java
public final class ConnectionSession {
private final BackendConnection backendConnection;
}
```
However, in BackendConnection's implements , like JDBCBackendConnection, ConnectionSession as one of its properties.
##### org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/JDBCBackendConnection.java
```java
public final class JDBCBackendConnection implements BackendConnection<Void>, ExecutorJDBCConnectionManager {
private final ConnectionSession connectionSession;
}
```
I think this is not good for java programming, Could you please explain the reason for this design? Thx .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] TeslaCN commented on issue #19051: Refer to each other in class "ConnectionSession" and "BackendConnection"
Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #19051:
URL: https://github.com/apache/shardingsphere/issues/19051#issuecomment-1182723815
In earlier version, there is a `BackendConnection` which includes all fields in `ConnectionSession` and `JDBCBackendConnection`. We want to decouple `BackendConnection` from JDBC, so we separated it into two classes.
`ConnectionSession` and `BackendConnection` is bound for a client of Proxy, so we make it refers each other.
Actually, this is similar to `HikariPool` and `HikariDataSource`, which refers each other.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] TeslaCN closed issue #19051: Refer to each other in class "ConnectionSession" and "BackendConnection"
Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #19051: Refer to each other in class "ConnectionSession" and "BackendConnection"
URL: https://github.com/apache/shardingsphere/issues/19051
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] TeslaCN commented on issue #19051: Refer to each other in class "ConnectionSession" and "BackendConnection"
Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #19051:
URL: https://github.com/apache/shardingsphere/issues/19051#issuecomment-1193946543
I'm closing this question for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org