简体   繁体   中英

dependency issue in modular Java project

So we're developing a modular java web application.

We have a contacts module and other modules that includes this contacts module. (like invoice, payments, leads etc.)

There is a entity in the contacts module for tracking entity transactions.

For each entity in other modules, a new record gets added to transactions entity.

I'll need to write a scheduled command that checks if the transactions are correct.

I think I need to take all the entries from modules like Invoice, Lead, Payments.

And I need to check if they're correct.

My question is:

Since this is a modular project I can't include Invoice, Lead, Payment as dependencies. How can I get all the records from other repositories? What design pattern should I follow?

Consider defining common interface for Invoice, Lead, Payment classes that will contain methods you need to extract the data for the verification purposes.

Contacts module will contain definition of that interface.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM