As I understand the problem, you want to separate 2 parts of software into components so they are independently deployable. T
his is important so that they are independently developable.
Why not just put them into separate gems / jar files? Why is that not enough?
For some reason there is an episode on Abstract Factory and Factory Method.
That doesn't sound like good solution to this problem to me.
I have never coded in Java, only C# and ruby (only ruby now) and I hope Java has something similar to Bundler.
In ruby jar files are called gems.
Bundler is software that takes care of your dependencies, which gems you depend on and exact versions.
So if Component 1 is using Component 2 it would be declared like this in Gemfile (file that bundler is using to install gems)
gem 'component_2', '~1.0.0' # means >= 1.0.0 and < 1.1
Running `bundle install` will install all dependencies and correct versions locally in the project.
Now group developing component 1 can use that version of component until they like. Component 2 can be independently developed.
Component 1 doesn't care about changes in component 2 because it is using a fixed version which never changes.
If they want to change, all they have to do is change version number in their Gemfile and run `bundle install` again.
To make this even easier, developers developing component 2 are using semver so everyone else can know what versions are compatible and what not.
When group developing component 2 wants to create a new version all they gotta do is create a tag in git saying something like `v1.0.1` and gem and bundler will know what version it is and what to do with it.
Why wouldn't this work in java?
Why would anyone use Abstract Factory or Factory method?
Is this a legacy problem or still exists in Java and why?