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
RubyConf Uruguay 2013 - New York, New York
Search
Patricio Mac Adden
March 23, 2013
Programming
2
97
RubyConf Uruguay 2013 - New York, New York
Patricio Mac Adden
March 23, 2013
Tweet
Share
Other Decks in Programming
See All in Programming
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
460
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
3
620
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
400
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
130
生成AI時代を勝ち抜くエンジニア組織マネジメント
coconala_engineer
0
26k
GISエンジニアから見たLINKSデータ
nokonoko1203
0
190
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
470
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.8k
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.4k
AIエージェントの設計で注意するべきポイント6選
har1101
5
2.4k
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
270
Java 25, Nuevas características
czelabueno
0
120
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
How to build a perfect <img>
jonoalderson
0
4.7k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
110
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
170
How to Talk to Developers About Accessibility
jct
1
86
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
230
Transcript
New York, New York
Patricio Mac Adden
[email protected]
maxawen
None
Esta charla es sobre Sinatra...
... y sobre buenas prácticas
“Is a DSL for quickly creating web-applications in Ruby.” -
Documentación oficial - Sinatra
Sinatra: routes
Sinatra: views
Sinatra: views
Sinatra: static files
Sinatra: static files
Sinatra: static files
Sinatra: filters
Sinatra: helpers
Sinatra: helpers
Sinatra: configuration
Sinatra: environments
Sinatra: error handling
Sinatra: classic
Sinatra: modular
Sinatra: rides on Rack
Pero...
“It isn’t a typical Model-View-Controller framework, but ties specific URL
directly to relevant Ruby code and returns its output in response. It does enable you, however, to write clean, properly organized applications: separating views from application code, for instance.” - Documentación oficial - Sinatra
Sin estructura de directorios por defecto
Sin ORM por defecto
Sin base de datos por defecto
Sin tasks
Sin test framework por defecto
¡No decide nada por nosotros!
Sinatra es ideal para prototipos, APIs y aplicaciones pequeñas
Pero también para aplicaciones grandes, ¿por qué no?
El problema
Sinatra es flexible
Desorden
¿Como organizar los controllers?
Uso inconsistente del DSL
Rutas no RESTful
Inline templates
Inline templates y templates estándar
etc.
La solución
La solución (no existe una única solución) Mi
Buenas Prácticas
* Definir una estructura de directorios
* ¿Cómo vamos a manejar los controllers?
* ORM (¿Necesitamos ORM?)
* Elegir una base de datos
* Elegir un Test framework
¿Classic o Modular?
* Configuración por defecto
* Configurar los diferentes entornos
* Elegir un template engine
== Application Template
Pero esto todavía no es un framework
* Tasks
* Autoload
Recordar:
Sinatra es flexible
Rack
Seamos inteligentes y usemos esto en nuestro favor
¿Preguntas?
¡Gracias!