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 8397169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:43:21+00:00 2026-06-09T20:43:21+00:00

From time to time I see projects that has a boot.scala or Boot.scala file

  • 0

From time to time I see projects that has a boot.scala or Boot.scala file in. Though this does not appear to be a hard and fast Scala rule, it does appear to be folklore of sorts to include a Boot.scala file in some projects. This specific project uses Akka and Spray, which translates to actor pattern and REST services.

Will someone please explain what type of functionality can normally be expected in such a file and if this is a common pattern of sorts?

As an extension to this question (please answer the first bit first :-), I would be grateful to know how to read this code, which is in a project with multiple Boot.scala files.

Boot.scala in web package:

trait Web {
  this: Api with Core =>
....
}

Boot.scala in api package:

trait Api {
  this: Core =>
....
}

Boot.scala in core package:

trait Core {
  implicit def actorSystem: ActorSystem
  implicit val timeout = Timeout(30000)

  val application = actorSystem.actorOf(
    props = Props[ApplicationActor],
    name = "application"
  )

  Await.ready(application ? Start(), timeout.duration)

}

One can gather that the one package depends on the other, and that the Boot.scala files may be a common sight in actor based systems, but what how does one ‘read’ the relationships? For example, how would I read trait Web {this: Api with Core =>…} in english?

In the particular instance, the starting point of the application lies in a main file:

object Main extends App {
  implicit val system = ActorSystem("RESTService")

  class Application(val actorSystem: ActorSystem) extends Core with Api with Web {

  }

  new Application(system)

  sys.addShutdownHook {
    system.shutdown()
  }

}

I realize my questions may seem trivial to some, but I’m trying to get into the Scala tribe here, and the ‘secret password’ is not in any manual.

  • 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-09T20:43:22+00:00Added an answer on June 9, 2026 at 8:43 pm

    I don’t know whether Boot.scala is a common pattern, but it is used in Lift and contains the main configuration of the application. Since Lift is rather old (relative to other scala projects) it might have set a convention.

    For the other question you should read up on the cake pattern and self types. For example

    trait Web {
      this: Api with Core =>
    ....
    }
    

    defines a trait Web that can only be mixed into classes or traits that inherit from API and Core or have those as part of their self types. Thus

    class Application(val actorSystem: ActorSystem) extends Core with Api with Web {
    
    }
    

    would not type check, if the Api trait wasn’t mixed in, because it is required by the Web trait.

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

Sidebar

Related Questions

From time to time I see something like this: class Clazz { private int
I have an TFS server installation that through time has gone through upgrades from
I want to see if a time I read from a db overlaps with
From time to time I run into the issue that Grails integration tests the
I realized that many of my past projects have suffered from too much ajax.
I realize this question has most likely been beaten to death, and that it's
I was compiling one of the projects I work with, this time with VS2010,
I have a C++ code base that has been working for a long time.
I have a workspace containing 2 projects: A project that has 2 products: a
Actionscript 3.0 has decent native XML support so I'm not surprised to see a

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.