Contenu connexe
Similaire à The Architect Way - JSCamp.asia 2012
Similaire à The Architect Way - JSCamp.asia 2012 (20)
Plus de Jan Jongboom (20)
The Architect Way - JSCamp.asia 2012
- 1. THE
ARCHITECT
WAY
Jan Jongboom
JSCamp.asia
November 30, 2012, Singapore
- 3. Program
• Cloud9? 5 minute intro + what's new
• Problems growing your codebase
• Introducing: Architect!
• Lessons learned
- 13. Program
• Cloud9? 5 minute intro + what's new
• Problems growing your codebase
• Introducing: Architect!
• Lessons learned
- 25. Program
• Cloud9? 5 minute intro + what's new
• Problems growing your codebase
• Introducing: Architect!
• Lessons learned
- 26. Architect
• Every piece of functionality is a plugin
• Plugins can consume other plugins
• An application is a set of plugins
- 27. Require Runtime
Architect Startup time
- 28. Dependency error handling
Architect style
coding time compile time run time
- Happy customers
- Developer keeps
- Fails before release job
- 29. Here’s what we do
• Code representation of this talk
• Get a speaker from the database
• Talk, talk, talk
• And end with a dance
- 40. What’s next?
• Extract the code
• Wrap in Architect plugin code
• It’s simple!
• Make two plugins
- 42. Architect plugin code
• Options, will get to that
• Imports, everything you consume
• Register, invoke when done
- 46. Dependencies
abstracted away
• Easily unit testable
• Mock dependencies
• Assert ‘talk’ function is called 5 times
- 51. No black magic
• Architect builds dependency model
• Feed architect a list of plugins
• Simple array with file names
• Call ‘createApp’
- 55. Configuration
• Per-plugin options
• No global options object
• Specify in config file
- 58. Options
• Automatically passed in at startup
• Options are also dependencies
• Fail if options aren’t present
• Use default assertions
- 61. Architect makes you think of
your app as
chunks of functionality
rather than sets of classes
- 62. Think
‘chunks of functionality’
• Implicit type constraints
• Keep implementation private
• Swap feature implementations
• Rather than interface implementations
- 63. How do we use it?
• Open source version
• Hosted version
• Normal
• FTP
• SSH
- 65. Swap feature per
implementation
• On Open source: talk local filesystem
• On FTP: talk FTP library
• On SSH: log in and talk via a SSH bridge
- 67. Centralized eventbus
• Loose coupling between plugins
• No hard dependencies!
• Can also do inter-context communication
- 71. And now scale up
• Need something inter-server
• Swap it with i.e. Redis PubSub
• Plugins will never notice
• Awesome!
- 72. Program
• Cloud9? 5 minute intro + what's new
• Problems growing your codebase
• Introducing: Architect!
• Lessons learned
- 73. Modularize in feature
blocks
• Don’t over engineer
• Don’t create too small blocks
• They are no interfaces!
- 78. http://c9.io
Jan Jongboom
github.com/janjongboom
@janjongboom