dimanche 11 novembre 2018

Adapter Pattern and packaging

I am working on a project that needs to be refactored in order to achieve decoupled modules.

I need to us an Adapter to decide which module to route to depending on some config.

                   +===========+
                   | Front-end |
                   +===========+
                    |         |
   +==================+      +==================+
   | RESTful Service1 |      | RESTful Service2 |
   +==================+      +==================+
                    |         |
             +=========================+      +=========+
             |          Adapter        | ---  | Config  |
             +=========================+      +=========+
               |          |          |
       +=========+   +=========+  +=========+
       | Module1 |   | Module2 |  | Module3 |
       +=========+   +=========+  +=========+

I have a Java application, and want to package the modules in JARS using Maven.

RESTful Service1 will either talk to Module1 or Module2 while RESTful Service2 will always talk to Module3. I need to establish which is the nest way to package these modules.

RESTful Service1 will be in it's own Jar while Module1 and Module2 will have their own Jars too.

Question

Seeing that RESTful Service2 will always talk toModule3 only, should they be in the same Jar? Or should I separate them into two seperate Jars too?

Thanks

Aucun commentaire:

Enregistrer un commentaire