vendredi 4 janvier 2019

How to access the service from different jar from parent project

I have following architecture of my project: There are two libs (imported as jar in POM.xml):

  • Component 1
  • Component 2

These libs are imported in the parent project to expose the public APIs. Now the scenario is Component 2 also depends upon some of the services from Component 1. (e.g. Component 2 may call Service A or Serive B from Component 1).

How can I make those services accessible to Component 2? I'm using Java & Spring.

`

+---------------------------------------------------------------------+
|                         Component Imported as jars                  |
|                                    +------------------------------+ |
|                                    |  Component 1                 | |
|                                    |                              | |
|                                    |                              | |
|                                    |  +-------------------------+ | |
|                                    |  |Service A                | | |
|                                    |  +-------------------------+ | |
|                                    |                              | |
|                                    |  +-------------------------+ | |
|                                    |  |Service B                | | |
|                                    |  +-------------------------+ | |
|                                    +------------------------------+ |
|  Parent Project                                                     |
|                                                                     |
|                                    +------------------------------+ |
|                                    |  Component 2                 | |
|                                    |                              | |
|                                    |  +-------------------------+ | |
|                                    |  |Service 1                | | |
|                                    |  +-------------------------+ | |
|                                    |  +-------------------------+ | |
|                                    |  |Service 2                | | |
|                                    |  +-------------------------+ | |
|                                    |                              | |
|                                    |                              | |
|                                    |                              | |
|                                    +------------------------------+ |
|                                                                     |
+---------------------------------------------------------------------+

Aucun commentaire:

Enregistrer un commentaire