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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Luca Guidi
November 05, 2015
Programming
330
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
950
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
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
250
今さら聞けないCancellationToken
htkym
0
220
GitHub Copilot CLIのいいところ
htkym
2
1.3k
AI時代のUIはどこへ行く?その2!
yusukebe
19
6.7k
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
400
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
450
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.2k
さぁV100、メモリをお食べ・・・
nilpe
0
130
OSもどきOS
arkw
0
450
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.3k
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
960
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
190
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
210
AI: The stuff that nobody shows you
jnunemaker
PRO
8
690
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Fireside Chat
paigeccino
42
3.9k
How to make the Groovebox
asonas
2
2.2k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
260
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
200
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Ruling the World: When Life Gets Gamed
codingconduct
0
250
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
480
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