Upload
jose-ignacio-fernandez
View
2.711
Download
2
Tags:
Embed Size (px)
Citation preview
FAIL
• Even in early stage, iterations can share code
• Code built today should be useful tomorrow
• Modularity helps
class User field :name, type: String field :email, type: String field :gender, type: String embeds_one :profile end
add_column :users, :name, :string add_column :users, :email, :string add_column :users, :gender, :string add_column :users, :profile_id, :reference
SQL
MongoDB
User.find(id) # => Mongoid::Errors::DocumentNotFound
User.find(id) # => ActiveRecord::RecordNotFound
SQL
MongoDB
user = User.new(email: ‘[email protected]’, name: ‘John’)
user.to_h # => { email: ‘[email protected]’, name: ‘John’ }
User.new(user.to_h)
MODEL
Responsible for serializing and deserializing
repo = UserRepository.new(db_config)
repo.put(user)
repo.find_one_by_id(user.id)
REPOSITORY
Responsible for storage and retrieval
user_service = UserService.new(user_repository)
user_service.visit_profile(user_id)
user_service.deactivate(current_user_id)
SERVICE
Business logic using models and repos
Ruby magic
class API api :get, ‘/:user_id’, :user_service, :visit_profile
api :delete, '/me', :user_service, :deactivate
... end
VISION
BIG HAIRY AUDACIOUS GOAL (BHAG)
KPI KPI KPI KPI
WEB MOBILE APP B2B API
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
VISION
BIG HAIRY AUDACIOUS GOAL (BHAG)
KPI KPI KPI KPI
WEB MOBILE APP B2B API
VIEWS MODEL DBANDROID
CODEIOS
CODESALES PR
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
VISION
BIG HAIRY AUDACIOUS GOAL (BHAG)
KPI KPI KPI KPI
WEB MOBILE APP B2B API
VIEWS MODEL DBANDROID
CODEIOS
CODESALES PR
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
FUNCTIONALITY
Jarg
on
The
rea
l shi
t
I’m coding this method to
let users log in with Facebook,
which affects the web product
to improve login conversion,
getting closer to the goal of…
in order to build a world where…
Jargon
Feature
Product
KPI
Goal
Vision