Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Currently, the number of parameters that the Session/SessionPool class can be configured by the user is increasing, leading to an increasing number of confusing constructors. Therefore, we can consider introducing the builder class SessionBuilder/SessionPoolBuilder in the Session/SessionPool class, so that users can focus only on the parameters they need to focus on. For the builder design pattern, you can refer to this .
// default Session session = new SessionBuilder().build() SessionPool sessionpool = new SessionPoolBuilder().build() // set remote ip Session session = new SessionBuilder().setHost("localhost").build() SessionPool sessionpool = new SessionPoolBuilder().setHost("localhost").build() // set remote ip // close cache leader Session session = new SessionBuilder().setHost("localhost").setEnableCacheLeader(false).build() SessionPool sessionpool = new SessionPoolBuilder().setHost("localhost").setEnableCacheLeader(false).build()
`
Of course, in order to ensure compatibility, the previous session construction interface can not be removed, we need to recommend that users gradually migrate to the builder creation method, so as to gain greater convenience
Attachments
Issue Links
- links to