In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail what are the new features of Play Framework 2.0. the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Play Framework has just released the official version 2.0, so let's take a look at the introduction of the new features of Play Framework 2.0.
Native support for Java and Scala
Play Framework 1.x is written entirely in Java and can support Scala through plug-ins, while version 2.0 has fully built-in support for Scala, and Play is the first to use Scala to develop applications, you can use Scala and Java to develop Play applications at the same time.
Controller written in Java
Controller written in Scala
Rapid reference development
In version 1.x, "Play feel" console-based application release and browser-based error reporting are provided, while Play 2.0 greatly extends the developer's ability to execute code snippets, tests, and execute SHELL scripts in the context of running the application.
Pushing Type Safety to a New Level
Thanks to statically typed languages, the compiler can examine parts of your code separately, which is why Play 2.0 defaults to writing Play applications based on the Scala template engine. This is not to say that you have to be proficient in Scala to do it. But familiarity with Scala is good for developing Play 2.0 applications.
Play 2.0 goes further in compiling and type checking. Routes (used to define the mapping of URL and action), templates, and resources can be compiled directly (using LESS, CoffeeScript, and Google Closure compiler), providing a unified development process, both on the client side and on the server side. The result is that more errors will be exposed during the development phase, speeding up the development process and making it easier to manage in large projects with multiple participants.
Route compilation error detection
Have more fun (Playing) Playing Nicely
Play 1.x implements technologies such as Java class properties and class hot loading through the Play-specific runtime environment. In Play 2.0 we take a more standard approach to runtime publishing, making it possible to write a core framework in Scala and build it on SBT.
Play 2.0 provides a "play new, run, start" experience as simple as Play 1.x, with an extensible infrastructure. Play 2.0 provides a preconfigured build script that allows most 1.x projects to run in 2.0 without modification. But if you want to modify the build and release of the application, you need to customize the adapter as needed.
Pick and Choose
In recent years, Web application technology has developed rapidly, and Play 2.0 provides a very advanced architecture that allows you to customize functions very flexibly. For example, if you don't want to use a database, you can disable the DBPlugin plug-in; if you want to use your own template engine, no problem, use the plug-in. You can decide the functions provided by Play according to your needs.
Disable plug-ins in conf/application.conf
Flexible scalability through Akka
Based on a lightweight, stateless, Web-friendly architecture, Play is characterized by predictability and minimal resource consumption (including CPU, memory, and threads), making it particularly suitable for developing highly scalable applications. This is partly thanks to Akka 2.0. Akka is a library written in Scala to simplify writing fault-tolerant, highly scalable Java and Scala Actor model applications.
In this example, you can see the non-blocking way that Calculator actor maps to Play
Above you can see that ChatRoomActor uses Comet to send messages
Advanced Ipaw O and stream processing
One of the very important technologies that Web develops are "push" and non-blocking technologies. Play 2.0 uses an Iteratee IO implementation for "push" and non-blocking support, as well as built-in WebSocket and Comet for file stream processing.
A Scala controller uses built-in WebSockets support
Ready, Steady, Play!
Are you ready to start your Play 2. 0 tour? You can take a look at some sample programs provided by Play 2.0 before making a decision:)
You can also see how to get started with Play 2.0 development.
Play! Project: the artifact of saving Java programmers: Play Framework
Your understanding of Java open source development framework Play Framework Java rapid development, programming is as easy as playing! Similar to other frameworks, not as good as legends! It sucks. I never use it! I haven't heard of it. I'm here to buy soy sauce.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.