0

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.

Community
  • 1
  • 1
Vineet Singla
  • 1,609
  • 2
  • 20
  • 34
  • I would assume the answers would still be valid. One way to start is to create facades for any outside facing system and instead of using the objects you use to communicate with the external world (via soap, http, whatnot), copy over the values to an internal object. Then try to find the logical demarcation points for the system. what group of features is switched on/off together, what works as an entirely separate subsystem. and then the fun, trawling through a great pile of code. I'm doing something similar at the moment, splitting apart switch statements of 1000+ lines. – Joeblade Dec 11 '14 at 13:28
  • How are you doing interactions between different modules ? – Vineet Singla Dec 15 '14 at 09:20

1 Answers1

1

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.

Joeblade
  • 1,735
  • 14
  • 22
  • How have you manage inter-module dependency ? Any framework , tools etc ? – Vineet Singla Dec 16 '14 at 12:30
  • @VineetSingla Currently i'm using Sonar's design screen to give me insight into what classes depend on what classes. other than that I use common sense. (my project doesn't exceed 500.000 lines of code, so it is manageable) – Joeblade Dec 17 '14 at 08:20
  • http://www.eclipsezone.com/articles/lattix-dsm/?source=archives this is comparable, no idea what tool they used specifically but it might help – Joeblade Dec 17 '14 at 09:04