Skip to content

Commit

Permalink
little boxes on the hillside, little boxes made of ticky tacky...
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 5, 2012
1 parent 64d3565 commit c85b737
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -443,11 +443,11 @@ incoming connections.
|- Worker [2]
|- Worker [3]
|- Worker [4]
`- Manager (new)
+- Manager (new)
|- Worker [1]
|- Worker [2]
|- Worker [3]
`- Worker [4]
+- Worker [4]
The new manager will automatically send a C<QUIT> signal to the old manager
and take over serving requests after starting up successfully.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -44,7 +44,7 @@ After reading the L<Mojolicious::Lite> tutorial, you should already be
familiar with L<Mojo::Server::Morbo>.

Mojo::Server::Morbo
`- Mojo::Server::Daemon
+- Mojo::Server::Daemon

It is basically a restarter that forks a new L<Mojo::Server::Daemon> web
server whenever a file in your project changes, and should therefore only be
Expand All @@ -63,7 +63,7 @@ of multiple cpu cores and copy-on-write.
|- Mojo::Server::Daemon [1]
|- Mojo::Server::Daemon [2]
|- Mojo::Server::Daemon [3]
`- Mojo::Server::Daemon [4]
+- Mojo::Server::Daemon [4]

It is also based on the L<Mojo::Server::Daemon> web server, but optimized
specifically for production environments out of the box.
Expand Down
40 changes: 20 additions & 20 deletions lib/Mojolicious/Guides/Growing.pod
Expand Up @@ -19,21 +19,21 @@ MVC is a software architectural pattern for graphical user interface
programming originating in Smalltalk-80, that separates application logic,
presentation and input.

.------------. .-------. .------.
+------------+ +-------+ +------+
Input -> | Controller | -> | Model | -> | View | -> Output
'------------' '-------' '------'
+------------+ +-------+ +------+

A slightly modified version of the pattern moving some application logic into
the C<controller> is the foundation of pretty much every web framework these
days, including L<Mojolicious>.

.----------------. .-------.
+----------------+ +-------+
Request -> | | <-> | Model |
| | '-------'
| | +-------+
| Controller |
| | .-------.
| | +-------+
Response <- | | <-> | View |
'----------------' '-------'
+----------------+ +-------+

The C<controller> receives a request from a user, passes incoming data to the
C<model> and retrieves data from it, which then gets turned into an actual
Expand All @@ -50,18 +50,18 @@ like C<http://mojolicio.us/foo> with your browser, you are basically asking
the web server for the HTML C<representation> of the
C<http://mojolicio.us/foo> C<resource>.

.--------. .--------.
+--------+ +--------+
| | -> http://mojolicio.us/foo -> | |
| Client | | Server |
| | <- <html>Mojo rocks!</html> <- | |
'--------' '--------'
+--------+ +--------+

The fundamental idea here is that all resources are uniquely addressable with
URLs and every resource can have different representations such as HTML, RSS
or JSON. User interface concerns are separated from data storage concerns and
all session state is kept client-side.

.---------. .------------.
+---------+ +------------+
| | -> PUT /foo -> | |
| | -> Hello world! -> | |
| | | |
Expand All @@ -75,7 +75,7 @@ all session state is kept client-side.
| | -> DELETE /foo -> | |
| | | |
| | <- 200 OK <- | |
'---------' '------------'
+---------+ +------------+

While HTTP methods such as C<PUT>, C<GET> and C<DELETE> are not directly part
of REST they go very well with it and are commonly used to manipulate
Expand Down Expand Up @@ -143,22 +143,22 @@ organized CPAN distribution to maximize maintainability.

myapp # Application directory
|- script # Script directory
| `- myapp # Application script
| +- myapp # Application script
|- lib # Library directory
| |- MyApp.pm # Application class
| `- MyApp # Application namespace
| `- Example.pm # Controller class
| +- MyApp # Application namespace
| +- Example.pm # Controller class
|- t # Test directory
| `- basic.t # Random test
| +- basic.t # Random test
|- log # Log directory
| `- development.log # Development mode log file
| +- development.log # Development mode log file
|- public # Static file directory (served automatically)
| `- index.html # Static HTML file
`- templates # Template directory
| +- index.html # Static HTML file
+- templates # Template directory
|- layouts # Template directory for layouts
| `- default.html.ep # Layout template
`- example # Template directory for "Example" controller
`- welcome.html.ep # Template for "welcome" action
| +- default.html.ep # Layout template
+- example # Template directory for "Example" controller
+- welcome.html.ep # Template for "welcome" action

Both application skeletons can be automatically generated.

Expand Down

0 comments on commit c85b737

Please sign in to comment.