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
Search
Luca Guidi
October 14, 2014
Programming
8
510
Lotus
Lotus: a complete web framework for Ruby.
Luca Guidi
October 14, 2014
Tweet
Share
More Decks by Luca Guidi
See All by Luca Guidi
Functional Web with Hanami
jodosha
4
390
Lessons Learned While Building Hanami
jodosha
4
1k
Lotus RubyDay 2015
jodosha
2
810
Lotus For Rails Developers
jodosha
2
260
Lotus - Brighton Ruby 2015
jodosha
3
850
A Rails Criticism
jodosha
4
1.6k
Other Decks in Programming
See All in Programming
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
1.1k
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
VisionProで部屋の明るさを反映させるシェーダーを作った話
segur
0
100
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
2
2.5k
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
400
return文におけるstd::moveについて
onihusube
1
1.4k
ESLintプラグインを使用してCDKのセオリーを適用する
yamanashi_ren01
2
220
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
580
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
200
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
180
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
580
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
173
51k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
The World Runs on Bad Software
bkeepers
PRO
66
11k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Unsuck your backbone
ammeep
669
57k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
How GitHub (no longer) Works
holman
312
140k
YesSQL, Process and Tooling at Scale
rocio
170
14k
Transcript
Lotus A c o mp l e t e web
framework @jodosha / #lotusrb
None
Do we need yet another web framework?
Are you reinventing the wheel?
What if we never reinvented the wheel?
The wheel
None
We reinvented the wheel after observing it
Complexity should be managed, not hidden.
Why does this matter?
The ultimate goal is…
Money https://flic.kr/p/aFAEHR
Use case: http://bit.ly/github-rails-upgrade
We should not trade control for convenience.
Cost of maintenance 0 20 40 60 80 Years 0
1 2 3 Covenience Simplicity
Silver bullets are a lie.
Philosophy
Standalone frameworks
Full stack applications
Few conventions More objects No monkey- patching
Few conventions More objects No monkey- patching
Few conventions More objects No monkey- patching
Simple
Simplicity is achieved by removing what isn’t essential
Coffee https://flic.kr/p/6rX8pn
Convenient https://flic.kr/p/93Bk4K
Simple https://flic.kr/p/mn57Zm
The output https://flic.kr/p/9oG93w
Lotus doesn’t enable optional features by default
We perceive as simple the things we are familiar with
BookRepository.find 23
Rails.application.routes.draw do get '/' => 'home#index', as: :home resources :books
end ! Rails.application.routes # => ???
router = Lotus::Router.new do get '/', to: 'home#index', as: :home
resources :books end ! router.path(:home) # => '/' router.call(env) # Rack env run router # in config.ru
Fast
Micro benchmarks http://bit.ly/lotus-micro-bench
HTTP benchmarks http://bit.ly/lotus-http-bench
Rails 1027.73 Sinatra 2207.73 Lotus 4175.90 http://bit.ly/lotus-http-bench req/s
Rails 1027.73 Sinatra 2207.73 Lotus 4175.90 http://bit.ly/lotus-http-bench req/s
Rails 1027.73 Sinatra 2207.73 Lotus 4175.90 http://bit.ly/lotus-http-bench req/s
Testable
Testability is a virtue
There is no “test-damaged” design
class Show include Lotus::Action ! expose :book ! def initialize(repository
= BooksRepository) @repository = repository end ! def call(params) @book = @repository.find params[:id] end end
book = Object.new repository = Minitest::Mock.new repository.expect(:find, book, [Integer]) !
action = Show.new(repository) action.call(id: 23) # => [200, {}, nil] ! repository.verify action.book.must_equal book # assigns(:book) isn’t needed
Demo
The future
Get involved
lotusrb.org #lotusrb @jodosha
Q&A
Thank you!