Skip to content

Move related class ConstructorComparator into package net.bytebuddy.description.method, FieldComparator into package net.bytebuddy.description.type #1352

@Joegardner11

Description

@Joegardner11

Hi, @raphw

Issue Description

Package net.bytebuddy.utility groups together miscellaneous classes that might be useful to different packages. The package structure violates the “high cohesion and low coupling” design rules. I found that class ConstructorComparator, and FieldComparator are not used by classes in their package, but strongly interact with classes in the other package (net.bytebuddy.description.method, net.bytebuddy.description.type) by checking the source code and the snippet of the dependency graph. The project has grown larger, leading to becoming increasingly hard to maintain. During the development process, one groups together classes (that often co-change) with similar responsibilities in one package to facilitate maintenance, which prevents a change that causes other packages to be modified. For example, if one modifies package net.bytebuddy.utility (i.e., package rename), and forget to change class MethodList during the maintenance process, there are indirect consequences for the class MethodList.

Location: The source file can be found at path File byte-buddy-dep/src/main/java/net/bytebuddy/utility/ConstructorComparator.java
byte-buddy-dep/src/main/java/net/bytebuddy/utility/FieldComparator.java

Refactoring suggestions

I suggest to move related class ConstructorComparator into package net.bytebuddy.description.method, FieldComparator into package net.bytebuddy.description.type.

ConstructorComparator-java
FieldComparator-java

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions