Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:29:34+00:00 2026-06-12T22:29:34+00:00

EDIT Complicating matters it appears that there is an issue (that is being worked

  • 0

EDIT
Complicating matters it appears that there is an issue (that is being worked on in Play 2.1 snapshot) where routes file change can also trigger the stampeding herd effect, which is to say, recompiling controllers and dependencies. Once that is resolved, and Scala 2.10 + SBT 0.12.1 performance enhancements are integrated, then it will become more clear how much I am shooting myself in the foot with trait-based DAO repository…

ORIGINAL
I am of the English speak many, many capable, don’t worry, just drawing you in….to the dreaded slow a$$ compilation zone

trait DaoProviderContract {
  def team:   TeamContract
  def player: PlayerContract
}
object DaoRepo extends DaoProviderContract {
  import com.company.utils.{Connection, Driver}
  implicit lazy val db = Connection.getHandle(Driver.DEFAULT)

  val team    = new TeamDAO
  val player  = new PlayerDAO
}
trait DaoProvider[Contract <: com.company.dao.DAOContract[_]] {
  val daoRepo = DaoRepo
  val dao: Contract
}
trait TeamData extends DaoProvider[TeamContract] {
  val dao: TeamContract = daoRepo.team
}
trait PlayerData extends DaoProvider[PlayerContract] {
  val dao: PlayerContract = daoRepo.player
}

and then in a controller, mixin a DAO component:

object Player extends Controller with PlayerData {
  ....
}

making a change to the above controller seems to be triggering the recompilation of all sources that depend on the DAO provider, which in my case is a bunch of controllers. The net affect is that often I’m seeing nearly 3/4 of my application recompiled, annoying.

Now, SBT 0.12.1 has improved in terms of compilation speed, but in terms of what it recompiles, my DAO repository implementation is clearly not helping matters.

So, my question is, in this case should I just scrap the traits and expose the DaoRepo object directly to controllers? The Player controller would then look something like:

import model.{DaoRepo => repo}
object Player extends Controller { // with PlayerData mixin gone
  def player(id: Int) = repo.player.get(id)
}

Am I correct in the assumption that making a change to the modified Player controller will NOT trigger the recompilation of 3/4 of my application? Impossible to test using the DaoRepo object directly, I know, but then waiting around is not terribly productive either.

Thanks for feedback if you’ve got it re: helping SBT recompile the necessary…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:29:36+00:00Added an answer on June 12, 2026 at 10:29 pm

    You can make SBT incremental process smarter by avoiding stuffing a single file with several traits/class/object definitions. If you have a file with:

    trait A { }
    trait B extends Base { }
    

    Changing the definition of Base will trigger a recompilation of the file, which will in turn trigger the recompilation of every file where A or B are referred…

    Try to split DAO and PlayerData class in several files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT : It turned out that this can only be done through an external
EDIT: I was an idiot. I simply had an image that was vertically long,
EDIT: See my answer below--> I am wanting to have a view that when
EDIT: iam using ajax to load text in my content that is why onload
Edit : Note that, as Daniel and latkin noted in an answer and a
EDIT: Here is the edited control file (control.ascx): <%@ Control Language=C# AutoEventWireup=true CodeFile=Sale.ascx.cs Inherits=Enmasse.Modules.Demo_Enmasse.Sale
I'm sure there's an easy answer here and i'm just over-complicating things, but i
Okay, I think I might be over-complicating this issue but I truly am stuck.
EDIT After staring at this for 2 days, I do see one issue. I
So, maybe I'm over-complicating something that isn't that hard, but here goes. In Ruby,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.