Kap5 Server Go Flashcards

1
Q

Was macht ein Multiplexer in general?

A

Dispatches/Routes incoming requests and maps URL to controller

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

Was macht ein Multiplexer in Go?

A

ServerMux is a struct thats maps a URL to a handler and DefaultServerMux is an instance of ServerMux

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

ServerMux exact match?

A

for any URL that does not end with a slash

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

ServerMux closest match?

A

for any URL pattern that ends with a

slash

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

Was macht ein Handler in general?

A

Controller process requests, are invoked by multiplexer/dispatcher and contain application logic

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

Was macht ein Handler in Go?

A

Controllers are handlers and they are interfaces that have a method named ServeHTTP with two parameters

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

What is important about templates?

A

Templates are a predesigned HTML page or fragment. The template engine combines data with template and contains embedded logic for data processing. Handlers usually call template engine to obtain resultant HTML

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

How are templates executed?

A

Templates are executed within handler and are usually the last statement of handler

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

Was macht ein Model in general?

A

Model defines application-related data, uniform access and management of data and Models are independent from storage strategy or technology

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

Why are Sessions important?

A

Modern web applications demand preserving the status of users over the duration of multiple requests

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

To preserve the status of users over the

duration of multiple requests…?

A

…each request needs to be linkable to one particular
user
…each request needs to carry user identifiable
information (aka session ID or user ID)
…user-specific session information needs to be
stored at server-side or encrypted on the client-side

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

What are the 2 technics to add user identifiable information to each request?

A

URL rewriting and Cookies

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

What are the cons of URL rewriting?

A

Each URL is extended by unique ID in query string, so the URLs contain sensitive information. Needs to be implemented on server-side and is not very commonly used anymore

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

Was are the benefits of Cookies?

A

Generated and assigned to particular used by server, Browser stores and manages cookies domain-wise. Adds valid cookie to each request for which cookie exists

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

What is important in Session management design?

A

Global session manager, keep session id unique, have one session for every user, session storage in memory, file or database

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