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
Lotus For Rails Developers
Search
Luca Guidi
November 05, 2015
Programming
340
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Lotus For Rails Developers
Luca Guidi
November 05, 2015
More Decks by Luca Guidi
See All by Luca Guidi
Functional Web with Hanami
jodosha
4
450
Lessons Learned While Building Hanami
jodosha
4
1.2k
Lotus RubyDay 2015
jodosha
2
960
Lotus - Brighton Ruby 2015
jodosha
3
910
Lotus
jodosha
8
570
A Rails Criticism
jodosha
4
1.7k
Other Decks in Programming
See All in Programming
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.7k
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.1k
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
340
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
140
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
380
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
190
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
1k
dRuby over BLE
makicamel
2
400
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.2k
Lessons from Spec-Driven Development
simas
PRO
0
240
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.9k
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
460
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
First, design no harm
axbom
PRO
2
1.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Being A Developer After 40
akosma
91
590k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
210
30 Presentation Tips
portentint
PRO
1
340
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
320
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
sira's awesome portfolio website redesign presentation
elsirapls
0
290
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
450
Design in an AI World
tapps
1
260
Transcript
Lotus For Rails Developers @jodosha / #lotusrb
Indie OSS dev & Freelancer
Why Lotus?
Lotus Philosophy
Lightweight
Features • Thread-safety • Full featured HTTP router • RESTful
resources • Actions and views as objects • Actions callbacks • Code sharing • Exception handling • Sessions • Secure Cookies • HTTP Caching • Automatic MIME Types • 20+ Template engines • Partials and layouts • Presenters • Routing helpers • Form helpers • HTML helpers • Automatic markup escape • CSRF and XSS prevention • Force SSL • Entities • Repositories • Data Mapper • SQL and Memory adapters • Dirty Tracking • Reusable validations • Mailers • Multiple environments • Static assets • JSON body parser • Params whitelisting and validation • Code generators • Rack servers support • Application console • Database console • Powerful CLI • Migrations • RSpec, Minitest and Capybara support • Several architectures • And more..
0 17,5 35 52,5 70 Ruby Rack Sinatra Lotus Rails
Dependencies Memory
On average, we use only a fraction of the features
that a gem provides.
Lotus depends on a few gems. You can be sure
that all the loaded code is useful for your application.
Lotus Foo Bar Baz Runtime dependency Transitive dependency
For each gem that we require, we’re adding overhead to
Ruby and Bundler.
There is no faster code than no code at all.
Less convenient
Example: Constant Autoloading • Differences across environments • ActiveSupport’s dependencies.rb
is ~800LOCs • lotus-controller gem is ~800LOCs • It took years to become stable • It modifies how Ruby VM loads code and features • It requires to “monkey-patch” Ruby Core
Solution: Eager loading • Same behaviour across environments • It’s
just 26LOCs • It isn’t a perfect solution • “Easy fix” via require
No monkey-patching
Don’t monkey-patch classes that you don’t own.
Testability
All the application components can be unit tested.
No need to maintain lotus-rspec or lotus- minitest gems.
A complete framework
Lotus goes beyond “Flat-MVC” by providing a set of collaborators
for “Full-MVC”.
Lotus toolkit
Full stack web apps
None
None
Lotus has a “Modular First” approach that helps you to
scale your code.
The Monolith is good for the first 5 years, but
then a framework should make your life easy.
None
Example #1
None
This is the name of the application under apps/
None
Web::Controllers::Home::Index For the app named Web we have Web::Action
None
None
None
For the app named Web we have Web::View Web::Controllers::Home::Index Web::Views::Home::Index
All the “exposures” and view’s public methods are available to
the template.
None
Exposure from the action
None
Example #2
One big ERb block
In order to avoid coupling with any ORM, it just
accepts symbols.
We have the routes factory to not overload the view
context with too many methods.
No need to concat these two div blocks.
Params validation is optional
This is the same name that we have set to
form_for.
Separation between entities and repositories.
No coupling with the routing system and the ORM
None
None
None
None
Useful resources
http://lotusrb.org Guides and API docs
http://lotusrb.org/mailing-list Subscribe to the mailing list at:
http://lucaguidi.com
http://lotusrb.org/hackday
Q&A
https://speakerdeck.com/jodosha/ lotus-for-rails-developers Slides available at:
Thank you