How to do modularity in the existing Java application?

282 views Asked by At

I have a very large java application with interdepent classes, it is being decided to convert our big application into modules. To start with this task, I would like to gather ideas.

My questions is almost same as asked here : How to modularize a (large) Java App?

Re-asking this question mainly because it was answered 5 years ago. Any new ideas are welcomed.

1

There are 1 answers

3
Joeblade On

This isn't the full answer to this question, I believe the link in the question is still valid. This answer is meant as some process suggestions.

One way to start is to create facades. Initially on paper decide where the boundaries of your modules lie. (which classes are part of a group of classes that make up a module) Then create a facade class (depending on the framework you use, implementing singleton or using spring for ioc) Then whenever you access a class from outside your module, have the outside class call the facade, and have the facade call the actual class.

If you have an external class do several calls on module classes then either this class belongs inside that module, or you need to extract the macro behaviour (series of calls and interactions) into 1 method and move that method into the facade.