asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yingyi Bu (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Remove Server Context
Date Sat, 29 Oct 2016 17:25:48 GMT
Yingyi Bu has posted comments on this change.

Change subject: Remove Server Context
......................................................................


Patch Set 1:

(1 comment)

I like various context classes.

At the high level, it provides:

(1)  a facet for separating concerns and modularizing code.  For example, AqlMetadataProvider
is an example that lacks those, which deserves more refactoring.

(2)  extensibility.  If you want to pass more things to a calling client, you just need to
pass the context, instead of every individual parameters.  If tomorrow you want to add things,
add things to the context and no interface (contract) will need to change.  That's also why
SonarQube warns us if we pass more parameters to a method.

https://asterix-gerrit.ics.uci.edu/#/c/1320/1/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/application/ApplicationContext.java
File hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/application/ApplicationContext.java:

Line 39:     public ApplicationContext(File baseDir, IApplicationConfig appConfig, ThreadFactory
threadFactory) {
Passing a serverCtx is easier to extend.

For example, if tomorrow you need to additional things into the class, you don't need to add
additional parameters.  So as other interfaces if any.

Again, maybe it's under utilized, but the design was well conceived.


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1320
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4261cf44410b498e84ffcac5e217281a306a7f03
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <bamousaa@gmail.com>
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mblow@apache.org>
Gerrit-Reviewer: Till Westmann <tillw@apache.org>
Gerrit-Reviewer: Yingyi Bu <buyingyi@gmail.com>
Gerrit-Reviewer: abdullah alamoudi <bamousaa@gmail.com>
Gerrit-HasComments: Yes

Mime
View raw message