Play Flashcards

1
Q

As at 2016 what was the only full-stack reactive web application framework for the JVM

A

play

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Play is built on top of _______ and leverages its reactive behaviour by using __________

A

Netty

Asynchronous stream handling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Play deals with the typical concerns of web application development such as client- side resource handling, project compilation, and packaging by making use of

A

the sbt build tool

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

They have certainly evolved a lot over the past decades, especially in terms of CPU clock speed (MHz to GHz) and memory (kilobytes to gigabytes). The most significant change, however, which has happened in the past few years, is that although the clock speed of CPUs isn’t increasing very much, the

A

the number of cores each CPU has is changing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is the von Neumann bottleneck

A

There is a shared bus between the program memory and data memory leads to the von Neumann bottleneck.
Because the single bus can only access one of the two classes of memory at a time, throughput is lower than the rate at which the CPU can work.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Roughly speaking, there are two categories of programming models in which web serv- ers can be placed.

A

Threaded

Evented

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The threaded model

A

large numbers of threads take care of handling the incoming requests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The evented model

A

a small number of request-processing threads communicate with each other through message passing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Example of a threaded server

A

Apache Tomcat, IIS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The evented model only works if

A

the entire pipeline is asynchronous

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the architectural challenge you seek to address with Actors and Events

A

Developing web applications fit for multicore architectures

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Languages and tools favoring the use of ______ _______make it easier to develop web applications that have to deal with concurrent access.

A

immutable state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Building applications that don’t fail is extremely difficult, and if those applications are meant to be built at a reasonable pace it’s close to impossible. Instead of avoiding failure, reactive systems are designed and built from the ground up to embrace failure, leveraging the principle of

A

supervision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the 8 fallacies of distributed computing

A
1 The network is reliable
2 Latency is zero
3 Bandwidth is infinite
4 The network is secure
5 Topology doesn’t change
6 There is one administrator
7 Transport cost is zero
8 The network is homogeneous
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an iteratee

A

An iteratee is a construct that allows you to consume streams of data asynchronously; it’s one of the cornerstones of the Play Framework.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The counterpart of an iteratee is

A

an enumerator

17
Q

Just as the iteratee is an ____________, the enumerator is an ____________

A

asynchronous consumer of data,

asynchronous producer of data:

18
Q

A component that lets you transform streaming data on the fly, called an

A

enumeratee

19
Q

An Enumeratee[From, To] does what

A

takes chunks of type From from an enumerator and transforms them into chunks of type To.

20
Q

How is using an Enumeratee different from using java.io.Inputstream and java.io.outputstream?

A

iteratees let you manipulate streams of data asynchronously. In prac- tice, this means that these streams won’t hold on to a thread in the absence of new data.
java.io.OutputStream blocks the thread it’s using until new data is available.

21
Q

What is the The iteratee the enumerator and enumeratee in the fawcet analogy

A
The enumerator is the fawcet
The Enumeratee is the nozzel of the fawcet
The iteratee is the class that receives the flow of water
22
Q

What is the collective term for iteratees, enumerators and enumeratees

A

Reactive streams

23
Q

What is set to replace iteratees in the next release of Play

A

Akka streams

24
Q

What are web sockets

A

is an advanced technology that makes it possible to open an interactive (full duplex) communication session between the user’s browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.

25
Q

Play’s WebSocket handling mechanism is built around

A

Akka streams

26
Q

play.extras.iteratees.Encoding.decode does what

A

decode a stream of bytes as a UTF-8 string.

27
Q

play.extras.iteratees.JsonIteratees.jsSimpleObject

A

parse a single JSON object.

28
Q

play.api.libs.iteratee.Enumeratee.grouped

A

will apply the jsSimpleObject iteratee over and over again until the stream is finished.

29
Q

what is needed for sbt to correctly run a play app

A

Play needs to be imported in both the

build. sbt (or build.scala) file as well as the
plugins. sbt file

30
Q

the _______________file is the page we will be able to see when we run our application

A

The views/main.scala.html file is the page we will be able to see when we run our application

31
Q

why the file is named main.scala.html and not main.html

A

because it is a twirl template

32
Q

what is the syntax to start a new play project using activator

A

activator new play-scala

33
Q

conf/messages ?

A

this is where all of the default messages are stored (you could then have a messages file for every other localisation e.g. conf/messages.en-us (for english)

34
Q

The I18nSupport trait gives you

A

an implicit Messages value as long as there is a Lang or a RequestHeader in the implicit scope.

35
Q

play.api.i18n.I18nSupport
play.i18n.I18nSupport
what is the difference?

A

the .api is reserved for scala, otherwise it is Java

36
Q

dependency injection

A

a technique whereby one object supplies the dependencies of another object

37
Q

In dependency injection passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern.

This fundamental requirement means that

A

using values (services) produced within the class from new or static methods is prohibited

38
Q

Twirl templates can be generated as a class rather than a static object by

A

declaring a constructor using a special @this(args) syntax at the top of the template.

39
Q

Default dependency injection framework for Play

A

Guice