Page 1
Architecture Over FrameworkRethink Your App Structure
Page 2
Tweet@_swanand
GitHub@swanandp
StackOverflow@18678
Build { Simplero }
[email protected]
Ruby, Clojure, Lisp, Rails,
Android, Emacs, TextMate,
RubyMine, Minitest, MySQL,
Zsh, Curl, Gmail, Hadoop,
Mavericks, Solarized,
Retina-MBP, Nexus 5
Oscar Wilde, Robert Jordan, J K Rowling, Quentin
Tarantino, Chris Nolan, Leonardo DiCaprio, Charlize
Theron, Metallica, Dream Theatre, Pink Floyd
Page 3
!if magic_code puts "I am in IF block"else puts "In ELSE block I am"end
!=> I am in IF block=> In ELSE block I am
how?
Page 4
!if fork puts "I am in IF block"else puts "In ELSE block I am"end
!=> I am in IF block=> In ELSE block I am
how?
Page 5
Looking Ahead
Why do this ?
Case Study: Discourse
Page 6
Looking Ahead
Why do this ? Case Study: Discourse
Page 7
Why do this ?
Clear Intent
Better Understanding
Page 8
Why do this ?
Clear Intent Better Understanding
Page 9
Architecture
Elements of a system
and their relationship
with each other
Page 10
Architecture
Designed such that
intent is apparent and
palpable
Page 11
FrameworkAn abstraction you
build upon, to provide
app specific software
Page 12
This picture screams RAILS!
Page 13
–Robert Martin
“This is good for DHH; but
not So good for you.”
http://www.confreaks.com/videos/759-rubymidwest2011-keynote-architecture-the-lost-years
Page 14
Why do this ?
Clear Intent
Better Understanding
Page 15
Debugging
bad code:
Frustration
Page 16
Debugging
good code:
Enlightenment
Page 17
Debugging
good code:
Learning
Page 18
Looking Ahead
Why do this?
Case Study: Discourse
Page 21
That’s not a lot, but
if you are new to
the project, then …
Page 22
http://media0.giphy.com/media/KE9cblgPK6EPS/200_s.gif
Page 27
File lookups are
fixed by managing
load path
Page 28
Const lookups are
fixed by managing
auto-load path
Page 30
config/application.rb
Page 33
http://38.media.tumblr.com/tumblr_maeu8e5wuj1rxmai6o1_500.gif
Page 35
First real limitation:
namespace based
look ups
Page 36
application_controller
Page 38
Second limitation:
unfriendly helper
customisation
Page 39
Second limitation:
unfriendly <foo>
customisation
Page 40
action_controller/helpers
Page 42
config/helper_railtie
Page 44
Looking BackFile structure (Load Path)
Const lookups (Auto Loads)
View Paths (Namespacing)
Helper Paths (Railties)
Page 45
Rearrange tests
Rearrange assets
Custom Rake tasks
Possibilities
Page 46
Muddle with Metal
Build your Rackware
Examine pre-forking
Possibilities