15. Como o cliente Como o Líder de Como o Analista Como o Programador Como o Consultor de
explicou Projeto entendeu desenhou escreveu Negócios descreveu
Como o projeto foi Como Operações Como o cliente foi O que o cliente
Como foi o suporte
documentado instalou cobrado realmente queria
34. cada padrão (“pattern”)
representa nosso melhor chute agora ...
os padrões ainda são hipóteses, ... e
portanto todos são tentativas, todos
livres para evoluir sob o impacto de
novas experiências e observações."
Christopher Alexander
103. > rails generate
Usage: rails generate GENERATOR [args] [options]
General options:
-h, [--help] # Print generator's options and usage
-p, [--pretend] # Run but do not make any changes
-f, [--force] # Overwrite files that already exist
-s, [--skip] # Skip files that already exist
-q, [--quiet] # Suppress status output
Please choose a generator below.
Rails: observer
controller performance_test
generator plugin
helper resource
integration_test scaffold
mailer scaffold_controller
migration session_migration
model stylesheets
104. > rake middleware Rack
Middlewares
use ActionDispatch::Static
use Rack::Lock
use ActiveSupport::Cache::Strategy::LocalCache
use Rack::Runtime
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use ActionDispatch::RemoteIp
use Rack::Sendfile
use ActionDispatch::Callbacks
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ParamsParser
use Rack::MethodOverride
use ActionDispatch::Head
use ActionDispatch::BestStandardsSupport
run Demo::Application.routes
105. Response Request
Web Server
Rack Middlewares
Routes
Controller
View Model
106. Response Request
Web Server
Rack Middlewares
Routes
Controller
View Model
107. Response Request
Web Server
Application
Rack Middlewares Server Rack:
Mongrel,
Routes Thin,
Passenger,
Controller Unicorn
View Model
108. Web Server:
NginX
Response Request
Apache
Web Server
Application
Rack Middlewares Server Rack:
Mongrel,
Routes Thin,
Passenger,
Controller Unicorn
View Model
194. class Animal
constructor: (@name) ->
move: (meters) ->
alert @name + " moved " + meters + "m."
class Snake extends Animal
move: ->
alert "Slithering..."
super 5
class Horse extends Animal
move: ->
alert "Galloping..."
super 45
sam = new Snake "Sammy the Python"
tom = new Horse "Tommy the Palomino"
sam.move()
tom.move()
195. var Animal, Horse, Snake, sam, tom;
var __hasProp = Object.prototype.hasOwnProperty,
__extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent,
key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
class Animal child.__super__ = parent.prototype;
constructor: (@name) -> return child;
};
Animal = (function() {
move: (meters) -> function Animal(name) {
this.name = name;
alert @name + " moved " + meters + "m." }
Animal.prototype.move = function(meters) {
return alert(this.name + " moved " + meters + "m.");
class Snake extends Animal };
return Animal;
move: -> })();
alert "Slithering..." Snake = (function() {
__extends(Snake, Animal);
super 5 function Snake() {
Snake.__super__.constructor.apply(this, arguments);
}
class Horse extends Animal Snake.prototype.move = function() {
alert("Slithering...");
move: -> return Snake.__super__.move.call(this, 5);
alert "Galloping..." };
return Snake;
super 45 })();
Horse = (function() {
__extends(Horse, Animal);
sam = new Snake "Sammy the Python" function Horse() {
tom = new Horse "Tommy the Palomino" Horse.__super__.constructor.apply(this, arguments);
}
Horse.prototype.move = function() {
alert("Galloping...");
sam.move() return Horse.__super__.move.call(this, 45);
tom.move() };
return Horse;
})();
sam = new Snake("Sammy the Python");
tom = new Horse("Tommy the Palomino");
sam.move();
tom.move();
loadrun