How to refactor tightly coupled classes?

后端 未结 6 1056
天命终不由人
天命终不由人 2021-02-10 02:35

I\'m trying to refactor a big tightly coupled application and trying to make it more maintainable and flexible.

I\'ve got many unit tests, so I\'m hoping to refactor ste

6条回答
  •  醉梦人生
    2021-02-10 03:02

    All of the above and then some. But before you start any of that, I'd think about the big picture. Define the sections of your program (packages, projects, etc) and then have a plan for moving functionality around to be in the appropriate package. Then once everything is where it logically should be start using extract interface, dependency injection, and factory methods to start de-coupling the packages.

提交回复
热议问题