Play is a web framework for Java and Scala that provides tools for building web applications and services. It aims to improve developer productivity through features like automatic reloading of code changes without restarts, integrated error handling and views, and native support for Scala. Play uses non-blocking I/O and supports event-driven architectures for improved concurrency and scalability compared to traditional threaded models.
Asynchronous web apps with the Play Framework 2.0Oscar Renalias
Brief introduction to the asynchronous and reactive IO capabilities available in Play 2.0.
Source code of the demos available here: https://github.com/oscarrenalias/wjax-2012-play-async-apps
Play Framework makes it easy to build web applications with Java & Scala. This presentation give a idea of how play is implemented using Netty, how routes work. How we get calls in controller's action. Walk through guice and logging.
Asynchronous web apps with the Play Framework 2.0Oscar Renalias
Brief introduction to the asynchronous and reactive IO capabilities available in Play 2.0.
Source code of the demos available here: https://github.com/oscarrenalias/wjax-2012-play-async-apps
Play Framework makes it easy to build web applications with Java & Scala. This presentation give a idea of how play is implemented using Netty, how routes work. How we get calls in controller's action. Walk through guice and logging.
There's plenty of material (documentation, blogs, books) out there that'll help
you write a site using Django... but then what? You've still got to test,
deploy, monitor, and tune the site; failure at deployment time means all your
beautiful code is for naught.
In The Trenches With Tomster, Upgrading Ember.js & Ember DataStacy London
A few months after I started working with Ember.js & Ember Data at my new job we began a project to upgrade both. There were parts that were a breeze and others that were quite tricky. This talk walks you through some of the challenges we faced and how we solved them as well as how we began to prepare for the Ember 2.x architectural shift. Hopefully this talk will help save you some time when you decide to upgrade your Ember web application.
Typesafe trainer and consultant Will Sargent describes just how Play Framework is so "fast" for Java and Scala production apps.
More Play, Akka, Scala and Apache Spark webinars, presentations, and videos:
http://typesafe.com/resources/videos
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Edureka!
This DevOps Tutorial takes you through what is Configuration Management all about and basic concepts of Infrastructure as code. It also compares the four most widely used Configuration Management tools i.e. Chef, Puppet, Ansible and SaltStack.
Check our complete DevOps YouTube playlist here: http://goo.gl/O2vo13
DevOps Tutorial Blog Series here: https://goo.gl/P0zAfF
Adobe AEM Maintenance - Customer Care Office HoursAndrew Khoury
This presentation covers how to maintain Adobe Experience Manager 6.x (AEM / CQ / Communiqué) environments.
See the presentation video here:
https://helpx.adobe.com/experience-manager/kt/eseminars/ccoo-aem-Aug-recording.html
Talk at RubyKaigi 2015.
Plugin architecture is known as a technique that brings extensibility to a program. Ruby has good language features for plugins. RubyGems.org is an excellent platform for plugin distribution. However, creating plugin architecture is not as easy as writing code without it: plugin loader, packaging, loosely-coupled API, and performance. Loading two versions of a gem is a unsolved challenge that is solved in Java on the other hand.
I have designed some open-source software such as Fluentd and Embulk. They provide most of functions by plugins. I will talk about their plugin-based architecture.
Drupal Perfomance. Talk given at DrupalCamp North, 25th July 2015.
This session looked at tools you can use to analyse the performance and benchmark a Drupal site. It then looked at tools and techniques that can be used to improve the site performance. The session also included a case study about the Drupal based BAFTA website that was built by Access. Focusing on the recent Film and TV awards, which saw a large amount of traffic in a short amount of time.
Master Chef class: learn how to quickly cook delightful CQ/AEM infrastructuresFrançois Le Droff
ConnectCon 2014 presentation
Francois and Nicolas share their latest experiment coding AEM 6 infrastructure with Chef. Learn how to start from bare metal - virtual, physical or cloud - servers and turn them, in matter of minutes, into a production ready AEM 6 infrastructure. Think author and publish farms, optional SSL, dispatcher, and clustering with MongoDB) Meanwhile you’ll be given a comprehensive overview of Chef resources and techniques enabling you to accelerate, scale, simplify and secure your development and release workflow.
Overview of Chef - Fundamentals Webinar Series Part 1Chef
This is an Overview of Chef. After viewing this webinar you will be able to:
- Describe how Chef thinks about Infrastructure Automation
- Define the following terms:
- Resource
- Recipe
- Node
- Run List
- Search
- Login to Hosted Chef
- Run `knife` commands from your workstation
Video of this webinar can be found at the following URL
https://www.youtube.com/watch?v=S5lHUpzoCYo&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbumZ
Java EE Servlet JSP Tutorial- Cookbook 1billdigman
http://wiki4.caucho.com/Java_EE_Tutorial_covering_JSP_2.2,_and_Servlets_3.0
This tutorial focuses on using Servlet's and JSP the right way. Servlet and JSP have evolved over the years, and now there is often more than one way to do things. For example, this tutorial uses EL and JSTL not JSP scriptlets, it uses JSPs in a Model 2/MVC style not in a model 1 style, etc. Consider it a tutorial that focuses only on the best practices and not the legacy ways to do things.
There are other tutorials on this subject, but this tutorial is going to be different in that it is going to put all code into github, and you can follow along with Eclipse. Also instead of focusing on JSF, we are going to focus on JSP and Servlets as the main view technology.
Java EE, JSP and Servlets have added a lot of features that are in other frameworks, making those other frameworks less relevant then they were before Java EE garnered these extra abilities. Even is you decide to use JSF, Struts, Stripes, Spring MVC, JSF, etc., this tutorial should help you have a better understanding of the JSP/Servlets core that they build on.
We are going to start by building a simple bookstore. We will progressively add more features to the bookstore and as we do we will use more of Java EE/CDI, JSP and Servlets.
For this tutorial, I am going to use Resin 4.0.x, but you could use any Java EE 6 Web Profile compliant application server.
10 Insightful Quotes On Designing A Better Customer ExperienceYuan Wang
In an ever-changing landscape of one digital disruption after another, companies and organisations are looking for new ways to understand their target markets and engage them better. Increasingly they invest in user experience (UX) and customer experience design (CX) capabilities by working with a specialist UX agency or developing their own UX lab. Some UX practitioners are touting leaner and faster ways of developing customer-centric products and services, via methodologies such as guerilla research, rapid prototyping and Agile UX. Others seek innovation and fulfilment by spending more time in research, being more inclusive, and designing for social goods.
Experience is more than just an interface. It is a relationship, as well as a series of touch points between your brand and your customer. Here are our top 10 highlights and takeaways from the recent UX Australia conference to help you transform your customer experience design.
For full article, continue reading at https://yump.com.au/10-ways-supercharge-customer-experience-design/
http://inarocket.com
Learn BEM fundamentals as fast as possible. What is BEM (Block, element, modifier), BEM syntax, how it works with a real example, etc.
There's plenty of material (documentation, blogs, books) out there that'll help
you write a site using Django... but then what? You've still got to test,
deploy, monitor, and tune the site; failure at deployment time means all your
beautiful code is for naught.
In The Trenches With Tomster, Upgrading Ember.js & Ember DataStacy London
A few months after I started working with Ember.js & Ember Data at my new job we began a project to upgrade both. There were parts that were a breeze and others that were quite tricky. This talk walks you through some of the challenges we faced and how we solved them as well as how we began to prepare for the Ember 2.x architectural shift. Hopefully this talk will help save you some time when you decide to upgrade your Ember web application.
Typesafe trainer and consultant Will Sargent describes just how Play Framework is so "fast" for Java and Scala production apps.
More Play, Akka, Scala and Apache Spark webinars, presentations, and videos:
http://typesafe.com/resources/videos
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Edureka!
This DevOps Tutorial takes you through what is Configuration Management all about and basic concepts of Infrastructure as code. It also compares the four most widely used Configuration Management tools i.e. Chef, Puppet, Ansible and SaltStack.
Check our complete DevOps YouTube playlist here: http://goo.gl/O2vo13
DevOps Tutorial Blog Series here: https://goo.gl/P0zAfF
Adobe AEM Maintenance - Customer Care Office HoursAndrew Khoury
This presentation covers how to maintain Adobe Experience Manager 6.x (AEM / CQ / Communiqué) environments.
See the presentation video here:
https://helpx.adobe.com/experience-manager/kt/eseminars/ccoo-aem-Aug-recording.html
Talk at RubyKaigi 2015.
Plugin architecture is known as a technique that brings extensibility to a program. Ruby has good language features for plugins. RubyGems.org is an excellent platform for plugin distribution. However, creating plugin architecture is not as easy as writing code without it: plugin loader, packaging, loosely-coupled API, and performance. Loading two versions of a gem is a unsolved challenge that is solved in Java on the other hand.
I have designed some open-source software such as Fluentd and Embulk. They provide most of functions by plugins. I will talk about their plugin-based architecture.
Drupal Perfomance. Talk given at DrupalCamp North, 25th July 2015.
This session looked at tools you can use to analyse the performance and benchmark a Drupal site. It then looked at tools and techniques that can be used to improve the site performance. The session also included a case study about the Drupal based BAFTA website that was built by Access. Focusing on the recent Film and TV awards, which saw a large amount of traffic in a short amount of time.
Master Chef class: learn how to quickly cook delightful CQ/AEM infrastructuresFrançois Le Droff
ConnectCon 2014 presentation
Francois and Nicolas share their latest experiment coding AEM 6 infrastructure with Chef. Learn how to start from bare metal - virtual, physical or cloud - servers and turn them, in matter of minutes, into a production ready AEM 6 infrastructure. Think author and publish farms, optional SSL, dispatcher, and clustering with MongoDB) Meanwhile you’ll be given a comprehensive overview of Chef resources and techniques enabling you to accelerate, scale, simplify and secure your development and release workflow.
Overview of Chef - Fundamentals Webinar Series Part 1Chef
This is an Overview of Chef. After viewing this webinar you will be able to:
- Describe how Chef thinks about Infrastructure Automation
- Define the following terms:
- Resource
- Recipe
- Node
- Run List
- Search
- Login to Hosted Chef
- Run `knife` commands from your workstation
Video of this webinar can be found at the following URL
https://www.youtube.com/watch?v=S5lHUpzoCYo&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbumZ
Java EE Servlet JSP Tutorial- Cookbook 1billdigman
http://wiki4.caucho.com/Java_EE_Tutorial_covering_JSP_2.2,_and_Servlets_3.0
This tutorial focuses on using Servlet's and JSP the right way. Servlet and JSP have evolved over the years, and now there is often more than one way to do things. For example, this tutorial uses EL and JSTL not JSP scriptlets, it uses JSPs in a Model 2/MVC style not in a model 1 style, etc. Consider it a tutorial that focuses only on the best practices and not the legacy ways to do things.
There are other tutorials on this subject, but this tutorial is going to be different in that it is going to put all code into github, and you can follow along with Eclipse. Also instead of focusing on JSF, we are going to focus on JSP and Servlets as the main view technology.
Java EE, JSP and Servlets have added a lot of features that are in other frameworks, making those other frameworks less relevant then they were before Java EE garnered these extra abilities. Even is you decide to use JSF, Struts, Stripes, Spring MVC, JSF, etc., this tutorial should help you have a better understanding of the JSP/Servlets core that they build on.
We are going to start by building a simple bookstore. We will progressively add more features to the bookstore and as we do we will use more of Java EE/CDI, JSP and Servlets.
For this tutorial, I am going to use Resin 4.0.x, but you could use any Java EE 6 Web Profile compliant application server.
10 Insightful Quotes On Designing A Better Customer ExperienceYuan Wang
In an ever-changing landscape of one digital disruption after another, companies and organisations are looking for new ways to understand their target markets and engage them better. Increasingly they invest in user experience (UX) and customer experience design (CX) capabilities by working with a specialist UX agency or developing their own UX lab. Some UX practitioners are touting leaner and faster ways of developing customer-centric products and services, via methodologies such as guerilla research, rapid prototyping and Agile UX. Others seek innovation and fulfilment by spending more time in research, being more inclusive, and designing for social goods.
Experience is more than just an interface. It is a relationship, as well as a series of touch points between your brand and your customer. Here are our top 10 highlights and takeaways from the recent UX Australia conference to help you transform your customer experience design.
For full article, continue reading at https://yump.com.au/10-ways-supercharge-customer-experience-design/
http://inarocket.com
Learn BEM fundamentals as fast as possible. What is BEM (Block, element, modifier), BEM syntax, how it works with a real example, etc.
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldabaux singapore
How can we take UX and Data Storytelling out of the tech context and use them to change the way government behaves?
Showcasing the truth is the highest goal of data storytelling. Because the design of a chart can affect the interpretation of data in a major way, one must wield visual tools with care and deliberation. Using quantitative facts to evoke an emotional response is best achieved with the combination of UX and data storytelling.
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
By David F. Larcker, Stephen A. Miles, and Brian Tayan
Stanford Closer Look Series
Overview:
Shareholders pay considerable attention to the choice of executive selected as the new CEO whenever a change in leadership takes place. However, without an inside look at the leading candidates to assume the CEO role, it is difficult for shareholders to tell whether the board has made the correct choice. In this Closer Look, we examine CEO succession events among the largest 100 companies over a ten-year period to determine what happens to the executives who were not selected (i.e., the “succession losers”) and how they perform relative to those who were selected (the “succession winners”).
We ask:
• Are the executives selected for the CEO role really better than those passed over?
• What are the implications for understanding the labor market for executive talent?
• Are differences in performance due to operating conditions or quality of available talent?
• Are boards better at identifying CEO talent than other research generally suggests?
Content personalisation is becoming more prevalent. A site, it's content and/or it's products, change dynamically according to the specific needs of the user. SEO needs to ensure we do not fall behind of this trend.
Each technological age has been marked by a shift in how the industrial platform enables companies to rethink their business processes and create wealth. In the talk I argue that we are limiting our view of what this next industrial/digital age can offer because of how we read, measure and through that perceive the world (how we cherry pick data). Companies are locked in metrics and quantitative measures, data that can fit into a spreadsheet. And by that they see the digital transformation merely as an efficiency tool to the fossil fuel age. But we need to stretch further…
Has the traditional intro to event looped servers (thanks Ryan!) with a couple of examples of why I think node.js is particularly exciting today. Code for the demos can be found at https://github.com/davidpadbury/node-intro.
Dave Orchard - Offline Web Apps with HTML5Web Directions
There’s an old expression, that there are only 2 hard problems in computing: naming, cache invalidation and off-by-one errors. Building offline web apps is all about those hard problems. There are some different ways of storing stuff — such as html5 caching, html5 storage, sqllite, and even native stores such as contacts and calendars — and we’ll sing their praises. But the really hard problems are knowing what to store, whether the stuff is still good or needs refreshing, how much to store, how to resolve conflicts between the client and server, how to integrate with data-specific stores, all in a bewildering cacophony of network and storage limited devices. We’ll spend the bulk of our time on these hard problems, which is probably more useful than api description and sample code.
Dave Orchard is Mobile Architect at Salesforce.com and located in Vancouver, Canada. This means being involved in many mobile platforms, architectures, tools, technologies and APIs. Prior to that, he was a co-founder of Ayogo Games and focused on iPhone and ruby/merb/mysql based casual social games. Back further in the mists of time, he was the Web standards lead for BEA Systems for 7 years, including being elected three times to 2 year terms on the W3C Technical Architecture Group chaired by Sir Tim Berners-Lee.
Follow Dave on Twitter: @DaveO
A fairly short (26 slides) presentation covering the GlassFish community and product (v2 and upcoming modular v3) as well as Java EE 5 and upcoming Java EE 6.
Welcome to the first live UiPath Community Day Dubai! Join us for this unique occasion to meet our local and global UiPath Community and leaders. You will get a full view of the MEA region's automation landscape and the AI Powered automation technology capabilities of UiPath. Also, hosted by our local partners Marc Ellis, you will enjoy a half-day packed with industry insights and automation peers networking.
📕 Curious on our agenda? Wait no more!
10:00 Welcome note - UiPath Community in Dubai
Lovely Sinha, UiPath Community Chapter Leader, UiPath MVPx3, Hyper-automation Consultant, First Abu Dhabi Bank
10:20 A UiPath cross-region MEA overview
Ashraf El Zarka, VP and Managing Director MEA, UiPath
10:35: Customer Success Journey
Deepthi Deepak, Head of Intelligent Automation CoE, First Abu Dhabi Bank
11:15 The UiPath approach to GenAI with our three principles: improve accuracy, supercharge productivity, and automate more
Boris Krumrey, Global VP, Automation Innovation, UiPath
12:15 To discover how Marc Ellis leverages tech-driven solutions in recruitment and managed services.
Brendan Lingam, Director of Sales and Business Development, Marc Ellis
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
24. Outline
1. Getting started with Play
2. Make a change and reload
3. Error handling
4. Threaded vs. evented
5. Non-blocking I/O
6. Scala
7. Performance
8. Community
25. Outline
1. Getting started with Play
2. Make a change and reload
3. Error handling
4. Threaded vs. evented
5. Non-blocking I/O
6. Scala
7. Performance
8. Community
32. Outline
1. Getting started with Play
2. Make a change and reload
3. Error handling
4. Threaded vs. evented
5. Non-blocking I/O
6. Scala
7. Performance
8. Community
33. public class HelloWorld extends Controller {
public static Result index() {
return ok("Hello World");
}
}
Create a new controller and action
app/controllers/HelloWorld.java
34. Don't worry about the use of static. Yes,
Play supports IOC. Using static (and other
shortcuts) lets me keep the examples simple.
40. public class HelloWorld extends Controller {
public static Result index(String name) {
return ok("Hello " + name);
}
}
Add a parameter
app/controllers/HelloWorld.java
45. public class HelloWorld extends Controller {
public static Result index(String name, int age) {
return ok("Hello " + name + " you are " + age +
" years old");
}
}
Add another parameter, this time an int
app/controllers/HelloWorld.java
46. GET /hello/:name/ :age controllers.HelloWorld.index(name: String, age: Int)
Add the parameter. Note the type checking!
conf/routes
48. @(name: String, age: Int)
<html>
<head></head>
<body>
<img src="/assets/images/play-logo.png"/>
<p>
Hello <b>@name</b>, you are <b>@age</b> years old
</p>
</body>
</html>
Add a view
app/views/hello.scala.html
49. public class HelloWorld extends Controller {
public static Result index(String name, int age) {
return ok(views.html.hello.render(name, age));
}
}
Render the view from the controller
app/controllers/HelloWorld.java
52. public class HelloWorld extends Controller {
public static Result index(String name, int age) {
String location = getConfig().getString("location");
return ok(views.html.hello.render(name, age,
location));
}
private static Configuration getConfig() {
return Play.application().configuration();
}
}
Read the config and pass it to the view
app/controllers/HelloWorld.java
53. @(name: String, age: Int, location: String)
<html>
<head></head>
<body>
<img src="/assets/images/play-logo.png"/>
<p>
Hello <b>@name</b>, you are <b>@age</b> years old
and you are at <b>@location</b>
</p>
</body>
</html>
Update the view
app/views/hello.scala.html
55. Outline
1. Getting started with Play
2. Make a change and reload
3. Error handling
4. Threaded vs. evented
5. Non-blocking I/O
6. Scala
7. Performance
8. Community
56. In dev mode, Play shows error messages
right in the browser.
62. Outline
1. Getting started with Play
2. Make a change and reload
3. Error handling
4. Threaded vs. evented
5. Non-blocking I/O
6. Scala
7. Performance
8. Community
66. Evented servers have one thread/process per
CPU core and use non-blocking I/O
MyNodeApp.js
var callback = function(data) {
console.log("Response: " + data);
};
var options = {
hostname: 'www.google.com',
path: '/upload'
};
// Non-blocking HTTP call
http.request(options, callback);
console.log('This line may execute before the callback!');
68. LinkedIn uses a Service Oriented Architecture
Internet Load
Balancer
Frontend
Server
Frontend
Server
Frontend
Server
Backend
Server
Backend
Server
Backend
Server
Backend
Server
Backend
Server
Data
Store
Data
Store
Data
Store
Data
Store
69. void doGet(HttpServletRequest req, HttpServletResponse res) {
// Call a number of backend services to get data
Profile profile = profileSvc.getProfile();
Company company = companySvc.getCompany();
Skills skills = skillsSvc.getSkills();
}
MyServlet.java
Our services spend most of their time waiting
for data from other services and data stores
71. In a threaded server, threads spend most of
the time idle, waiting on I/O
72. Threading dilemma
1. Creating new threads on the fly is expensive:
a. Use a thread pool
2. Too many threads in the thread pool:
a. Memory overhead
b. Context switching overhead
3. Too few threads in the thread pool:
a. Run out of threads, latency goes up
b. Sensitive to downstream latency!
82. Play is built on top of Netty, so it supports non-
blocking I/O [6]
83. NIO benefits
1. No sensitivity to downstream slowness
2. Easy to parallelize I/O
3. Supports many concurrent and long-running
connections, enabling:
a. WebSockets
b. Comet
c. Server-Sent Events
84. Outline
1. Getting started with Play
2. Make a change and reload
3. Error handling
4. Threaded vs. evented
5. Non-blocking I/O
6. Scala
7. Performance
8. Community
85. public class Proxy extends Controller {
public static Result index(String url) {
// Non blocking HTTP call
Promise<Response> responsePromise = WS.url(url).get();
// How do we turn a Promise into a Play Result?
}
}
app/controllers/Proxy.java
Use Play's built in WS library to make a non-
blocking HTTP call
87. (Play Framework source code)
Play has a built-in subclass of Result called
AsyncResult that takes a Promise<Result>
public static class AsyncResult implements Result {
private final Promise<Result> promise;
public AsyncResult(Promise<Result> promise) {
this.promise = promise;
}
}
88. public class Proxy extends Controller {
public static Result index(String url) {
// Non blocking HTTP call
Promise<Response> response = WS.url(url).get();
// Transform asynchronously into a Play Result
Promise<Result> result = response.map(toResult);
return async(result);
}
// A function that can transform a Response into a Result
private static Function<Response, Result> toResult =
new Function<Response, Result>() {
public Result apply(Response response) {
return ok(response.getBody()).as("text/html");
}
};
}
app/controllers/Proxy.java
We can use the map method to turn a
Promise<Response> into a Promise<Result>
92. public class Proxy extends Controller {
public static Result index(String url) {
Logger.info("Before the HTTP call");
Promise<Response> response = WS.url(url).get();
Promise<Result> result = response.map(toResult);
Logger.info("After the HTTP call");
return async(result);
}
private static Function<Response, Result> toResult =
new Function<Response, Result>() {
public Result apply(Response response) {
Logger.info("Inside the toResult function");
return ok(response.getBody()).as("text/html");
}
};
}
app/controllers/Proxy.java
To see that it's non-blocking, let's add logging
93. Refresh the page and the logs show the
HTTP call really is non-blocking
95. class Timing {
public String url;
public long latency;
public Timing(String url, long latency) {
this.url = url;
this.latency = latency;
}
// Fire an HTTP request and record how long it took
public static Promise<Timing> timedRequest(final String url) {
final long start = System.currentTimeMillis();
Promise<Response> res = WS.url(url).get();
return res.map(new Function<Response, Timing>() {
public Timing apply(Response response) {
long latency = System.currentTimeMillis() - start;
return new Timing(url, latency);
}
});
}
}
app/models/Timing.java
First, define a class that times an HTTP request
96. public class Parallel extends Controller {
public static Result index() {
// A Promise that will redeem when the 3 parallel
// HTTP requests are done
Promise<List<Timing>> all = Promise.waitAll(
Timing.timedRequest("http://www.yahoo.com"),
Timing.timedRequest("http://www.google.com"),
Timing.timedRequest("http://www.bing.com")
);
// Asynchronously transform timings into a JSON response
return async(all.map(new Function<List<Timing>, Result>() {
public Result apply(List<Timing> timings) {
return ok(Json.toJson(timings));
}
}));
}
}
app/controllers/Parallel.java
Next, add a controller that fetches 3 URLs in
parallel and returns the timings as JSON
99. Outline
1. Getting started with Play
2. Make a change and reload
3. Error handling
4. Threaded vs. evented
5. Non-blocking I/O
6. Scala
7. Performance
8. Community
112. Outline
1. Getting started with Play
2. Make a change and reload
3. Error handling
4. Threaded vs. evented
5. Non-blocking I/O
6. Scala
7. Performance
8. Community
116. Raw horsepower: theoretical maximum
performance for the server in ideal
conditions. A measure of language and
framework overhead.
117. Concurrent horsepower: performance with
many users, I/O, and more real-world
scenarios. A measure of the framework's
approach to concurrency.
118. Single developer: how easy it is to get
started, how quickly a single developer can
build things. A measure of the framework's
raw productivity and tooling.
119. Multiple developers: how the framework
tolerates many developers working
concurrently over many years. A measure of
code rot and maintainability.
120. Here is how I'd rate some of the
frameworks I've used. YMMV.
121. ● Pros
○ Good raw throughput (qps, latency)
○ Type safety reduces code rot
● Cons
○ Not developer friendly. Getting things done takes
forever.
○ Threaded, synchronous approach difficult to scale
for lots of I/O in a SOA environment.
MVC
123. ● Pros
○ Set the bar for developer productivity; all other
frameworks are still trying to catch up.
● Cons
○ Ruby is slow
○ Ruby doesn't have real multithreading nor a great
evented framework
○ Dynamic language makes it tougher to maintain a
large codebase
125. ● Pros
○ v8 engine is pretty fast for raw throughput
○ Non-blocking I/O at the core makes concurrency
easy
○ Strong open source community and lightning fast
startup time makes it easy to get things done quickly
● Cons
○ Dynamic language makes it tougher to maintain a
large codebase
○ Lots of immature libraries that constantly make
backwards incompatible changes
127. ● Pros
○ Fast for raw throughput
○ Non-blocking I/O at the core makes concurrency
easy
○ Hot reload makes it possible to get things done
quickly
○ Strong type safety throughout reduces code rot
● Cons
○ Even with hot reload, a compiled statically typed
language isn't quite as fast as an interpreted
dynamically typed language
129. Outline
1. Getting started with Play
2. Make a change and reload
3. Error handling
4. Threaded vs. evented
5. Non-blocking I/O
6. Scala
7. Performance
8. Community
137. Recap
1. Getting started with Play
2. Make a change and reload
3. Error handling
4. Threaded vs. evented
5. Non-blocking I/O
6. Scala
7. Performance
8. Community