2

I have project in PlayFramework. It has one main project without any code/logic. And it have few submodules:

  • main:
    • admin
    • common
    • shop

Modules: admin and shop will base on common module (classes like: user, role, permission), so I have to configure it that way:

  lazy val shop = project.in(file("modules/shop"))
  .dependsOn(cirs)
  .dependsOn(common)
  .dependsOn(admin)  

  lazy val admin = project.in(file("modules/admin"))
  .dependsOn(cirs)
  .dependsOn(common)
  .dependsOn(shop)      

But in module common I have view where I want to display links (a href...) to other submodules. To do this I have to use reverse routing classes, which are controllers in submodules: shop and admin. So I have to use something like that:

<a href="@controllers.shop.routes.Index.index">shop</a>
<a href="@controllers.admin.routes.Index.index">admin</a>

Which mean that I have to also add .dependsOn(shop).dependsOn(admin) for common module.

But it cause a Cyclic dependencies, which is incorrect!

Please help me. How can I deal with it?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
masterdany88
  • 5,041
  • 11
  • 58
  • 132

0 Answers0