Skip to content

[FEATURE] Refactor ExtensionsRunner class #116

@dbwiddis

Description

@dbwiddis

Is your feature request related to a problem?

ExtensionsRunner is getting big, could we compartmentalize this functionality? Maybe there is a pattern like configuration/registration/request handling?

Originally posted by @peternied in #109 (comment)

What solution would you like?

There are 513 lines.

  • Up to line 156 is headers, constructors, initializers, getters, setters, etc.
  • Line 157-244 is handler methods that are registered in lines 328-390
  • Line 246-390 is initializing the transport service and registering the above request handlers
  • Line 392-471 is sending transport requests
  • Line 473-513 is back to setters and startup methods

We can definitely separate out lines 157-471 into at least one other class, possibly two or three.

  • each of the handlers in lines 157-244 could probably have its own class.
  • the transportService.registerRequestHandler() calls are all the same except for two lines, and could benefit from a helper method for the 80-90% of that code that is common. (these are all single method calls but take up several lines, probably ok to leave).
  • The Netty4 and initialize transport service can probably be moved to their own class. (Speaking of netty4, there are some old third party license files that can be removed).

What alternatives have you considered?

Doing nothing. It's tempting.

Do you have any additional context?

Like most code, this starts small and grows to the point where the problem is obvious. We're there.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions