Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Clean Up Your Views
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Luis Edimerchk Laverde
September 20, 2016
Programming
0
120
Clean Up Your Views
Slides for my talk in Medellin.rb
Luis Edimerchk Laverde
September 20, 2016
Tweet
Share
More Decks by Luis Edimerchk Laverde
See All by Luis Edimerchk Laverde
Refactoring a Rails API
edymerchk
0
210
Aplicaciones Web utilizando Ruby on Rails
edymerchk
0
55
Testing like gods
edymerchk
1
130
Other Decks in Programming
See All in Programming
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
140
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
430
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
460
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
700
Architectural Extensions
denyspoltorak
0
290
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
710
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
220
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
340
Technical Leadership for Architectural Decision Making
baasie
1
240
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Marketing to machines
jonoalderson
1
4.6k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
140
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Optimizing for Happiness
mojombo
379
71k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
940
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
A designer walks into a library…
pauljervisheath
210
24k
Designing for humans not robots
tammielis
254
26k
Transcript
CLEAN UP YOUR VIEWS @edymerchk
LUIS EDYMERCHK LAVERDE
None
None
BUT…
rails-api
RAILS VIEWS
None
EXAMPLE 1. Reviewed at : August 18, 2016 2. Reviewed
at : No Reviewed yet
None
HELPERS TO THE RESCUE
None
HELPERS… ➤ Global Namespace ➤ Object-disoriented functions ➤ Helpers are
modules ➤ Called without an obvious receiver
Helpers
MODEL METHODS TO THE RESCUE
None
DESIGNS PATTERNS
“ Design pattern is a general reusable solution to a
commonly occurring problem within a given context
Module Mediator Facade Factory Chain Memento Visitor Abstract Broker Builder
Iterator Proxy Decorator Strategy Prototype Observer Template Active Record Composite Command Data transfer object MVC Singleton Reactor GRASP
DECORATOR
“ The decorator is a design pattern that allows behavior
to be added to an individual object, either statically or dynamically,Type a quote here. -wikipedia
DECORATOR IN RAILS
“ mkdir app/decorators touch app/decorators/object_decorator.rb
None
None
None
None
BENEFITS ➤ Flexibility ➤ Organization & Readability ➤ Testing!!! ➤
Open Close Principle ➤ Split logic
DRAPER
THANKS!!