Skip to content

Conversation

@jbpextra
Copy link

@jbpextra jbpextra commented Dec 11, 2020

As explained in #465 , a cyclic dependency between LoadBalancerStats and ServerStats has created a persistent negative impact on developers when working in these classes. We have computed this negative impact to be as high as 12% in some commits, with a persistent effect of an average 4.5%

Specifically, these classes are very tightly coupled by their shared dynamic configuration attributes. The UnboxedIntProperty attributes of both this classes are reference to the same objects. This makes the source code more difficult to maintain and therefore these needs to be encapsulated in its own abstraction.
image

Changes:

We introduce a new class called ConfigStats that encapsulate these attributes. Its associated methods others have been moved from LoadBalancer to this new class. Instances of both LoadBalancer and ServerStats own a ConfigStats object which they use to access the now encapsulated UnboxedIntProperty using primitive getter/setters. Thus, the underlying dynamic configuration logic is effectively abstracted away and the cyclic dependency is dissolved.
image

TECHNICAL DEBT: a cyclic dependency between LoadBalancerStats and ServerStats has created a persistent negative impact on developers when working in these classes. Specifically, these classes are very tightly coupled by their shared dynamic configuration attributes.

**Changes**
REFACTORING: Introduce a new ConfigStats class that encapsulates the configuration attributes shared by LoadBalancerStats and its ServerStats as well as its associated methods. ConfigStats implements the IConfigAware interface.

No breaking changes.
@jbpextra jbpextra marked this pull request as ready for review December 11, 2020 15:27
@jbpextra
Copy link
Author

jbpextra commented Jan 5, 2021

Hi @carl-mastrangelo , could you have a look at the pull request? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant