Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the point of splitting up a project into 2 separate projects? [closed]

Tags:

java

A lot of times I see people splitting up a Project into 2 separate projects, like in this screenshot:

enter image description here

What is the point of seperating Ingot and IngotAPI instead of putting them both in the same project because they get compiled together anyways?

like image 598
Garrett Avatar asked Oct 31 '22 17:10

Garrett


1 Answers

Several cases.

Need or desire to have API decoupled from (one of) its implementation. With the Java SPI (Service Provider Interface) you provide just an interface, against which client application program. Then the java SPI provides a lookup to use one of the possible implementations. Used for the XML parser. Similar for JDBC. Decoupling an API means that a client need not be recompiled if the API remains unchanged, but the implementation was changed.

In general having several projects allows to consider every project a module, a unit that imports a specified list of other modules, and forms a layered hierarchy. This can give a software system much higher quality, no back and forth imports. Next generation java will get modules.

like image 51
Joop Eggen Avatar answered Nov 15 '22 05:11

Joop Eggen