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
490
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
370
Lessons Learned While Building Hanami
jodosha
4
850
Lotus RubyDay 2015
jodosha
2
660
Lotus For Rails Developers
jodosha
2
220
Lotus - Brighton Ruby 2015
jodosha
3
830
A Rails Criticism
jodosha
4
1.5k
Other Decks in Programming
See All in Programming
WinUI 3デモ - "CommunityToolkit.Mvvm"NuGetパッケージ編
andrewkeepcoding
0
140
プロンプトエンジニアリング入門
tomokusaba
2
990
C# 大統一理論推進委員会 会員のための Unity Package Manager プロジェクト構成案
monry
PRO
0
580
決断するための勇気、そのためのBacklog / Courage to make decisions, Backlog for that.
seike460
PRO
4
1.9k
RubyVM を PHP で実装する 〜Hello World を出力するまで〜
memory1994
PRO
1
490
自作ソフト(VMagicMirror)がVRMA対応してる話+実装のTips
bakudreameater
0
110
15分間でふんわり理解するDocker @ Matsuriba MAX
ukwhatn
PRO
1
340
incrementalモデルの理解を深める
ikkimiyazaki
2
640
DDD, necessary but insufficient: physical design principles for microservices
cer
PRO
0
2.2k
CircleCIを活用して AWSへの継続的デリバリーを 実践する
coconala_engineer
1
110
TDDと今まで
kanayannet
0
140
Deno に Web 標準 API を実装する / Implementing Web Standard API to Deno
petamoriken
0
350
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
1
1.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
28
46k
Building Your Own Lightsaber
phodgson
97
5.6k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.8k
GitHub's CSS Performance
jonrohan
1023
450k
Designing the Hi-DPI Web
ddemaree
275
33k
Debugging Ruby Performance
tmm1
68
11k
GraphQLとの向き合い方2022年版
quramy
28
12k
Agile that works and the tools we love
rasmusluckow
323
20k
Building Effective Engineering Teams - LeadDev
addyosmani
25
1.8k
Building Flexible Design Systems
yeseniaperezcruz
317
37k
Happy Clients
brianwarren
91
6.3k
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!