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
380
Lessons Learned While Building Hanami
jodosha
4
990
Lotus RubyDay 2015
jodosha
2
800
Lotus For Rails Developers
jodosha
2
250
Lotus - Brighton Ruby 2015
jodosha
3
840
A Rails Criticism
jodosha
4
1.6k
Other Decks in Programming
See All in Programming
useSyncExternalStoreを使いまくる
ssssota
6
1.2k
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
140
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
480
テストコード書いてみませんか?
onopon
2
140
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
140
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
790
From Translations to Multi Dimension Entities
alexanderschranz
2
140
情報漏洩させないための設計
kubotak
3
350
Featured
See All Featured
Docker and Python
trallard
42
3.1k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Typedesign – Prime Four
hannesfritz
40
2.4k
Unsuck your backbone
ammeep
669
57k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Building Your Own Lightsaber
phodgson
103
6.1k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Mobile First: as difficult as doing things right
swwweet
222
9k
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!