Who is using play framework
You also get a significant performance gain on these parts at run-time. We initially introduced this work as an external module, to be able to experiment freely without impacting the framework itself. Properly integrating Scala into a Java-based framework is not trivial. This, however, is certainly not the optimal way of using the language. Scala is a mix of true object orientation with functional programming. We quickly reached the limits of what we can do with Scala support as a separate module.
Initial design choices we made in Play 1. Meanwhile, we have created several awesome components for the Scala module, such as the new type-safe template engine and the brand new SQL access component Anorm.
This is why we decided that, to fully unleash the power of Scala with Play, we would move Scala support from a separate module to the core of Play 2, which is designed from the beginning to natively support Scala as a programming language.
Java, on the other hand, is certainly not getting any less support from Play 2; quite the contrary. The Play 2 build provides us with an opportunity to enhance the development experience for Java developers. From the beginning of the Play project, we have chosen a fresh way to run, compile and deploy Play applications. It may have looked like an esoteric design at first, but it was crucial to provide an asynchronous HTTP API instead of the standard Servlet API, short feedback cycles through live compilation and reloading of source code during development, and promoting a fresh packaging approach.
Consequently, it was difficult to make Play follow the standard JEE conventions. Today, this idea of container-less deployment is increasingly accepted in the Java world. Existing Java build systems, however, were not flexible enough to support this new approach. Since we wanted to provide straightforward tools to run and deploy Play applications, in Play 1. Meanwhile, developers using Play for more enterprise-scale projects, which require build process customization and integration with their existing company build systems, were a bit lost.
The Python scripts we provided with Play 1. There, you can override config or define your own. In Scala, things are similar, except you need to inject play. Configuration instead:. You can specify additional config files to deal with configuration that varies between environments. See more about how Play uses it here. Play uses the sbt build tool for managing dependencies, compiling the app, running the app, running the tests, and packaging the app.
The primary build definition is in the build. The libraryDependencies section of the build. You can also add your own Maven repository using the resolvers setting. The dependencies in libraryDependencies are a comma-separated list in this form:. This can improve build times and make different pieces more easily reusable. Over 2 million developers have joined DZone. Written By. Table of Contents. Unzip it and run ". Your new project has the following layout: Directory Description app The app source directory for Java, Scala, and client side source code.
You can also have default and optional parameters. Result; import play. Inject import play. BaseController import play. The Controller class in the Java API has some convenience methods to interact with the other parts of the request and response: Method Description ctx Returns the HTTP context, which can be used to retrieve and store data relevant to the current request.
User; import play. Json; import play. Controller; import com. Here is a simple Java and JUnit test of a controller: package controllers; import org. Test; import play. Application; import play. GuiceApplicationBuilder; import play. Http; import play. WithApplication; import static org. OK; import static play. GET; import static play. Section Inject; import com. Configuration instead: import javax. Like This Refcard? Free DZone Refcard. Let's be friends:.
Sep 24, Fix cron jobs repo. Aug 26, Jun 16, Original string and character position in message. Sep 7, Sep 30, Fix path in. Oct 1, Jan 11, Remove status:merge-when-green label after merge and mark Steward's…. Oct 28, Feb 12, Fix, refactor and add stuff to scala-steward conf.
Aug 31, Update scalafmt-core to 2. Dec 9,
0コメント