Architecting Rails apps
Studies and thoughts from a Front End perspective.
- Passionate about web and it's ecossystem
- Software Developer at Codeminer 42
We Are Hiring!
- No code examples :(
- Keep focus on the theory
- Don't get it to hard
Why Front-end Perspective?
- Common problems
- Same responsibilities
The bad Rails
- Built on top of MVC
- Changes affects other parts of the app
- Top level structure screams the web framework
- We don't know what it does
MVC is a delivery design pattern.
- Uncle Bob
What is Architecture anyway?!
- Independent of technology/framework
- Makes software easier to change and test
- Entities and business Rules
- Used by the application layer to define use cases
- Examples: User, Article
- Use cases and actual behavior
- Interacts with Domain units
- Adapts the Infrastructure Layer
- Examples: CreateUser, CreateArticle
- Interacts with the external world of the application
- The lowest of them
- Databases, email services, external APIs
- Examples: UserRepository, MailChimpService, ArticlesService
- The entry point
- Should only receives user input
- Returns a response to the user
- Controllers, CLIs, WebSockets, GUIs
- Examples: UsersController, ArticlesController
- Keep it simple
- You don't need to use everything
- Find what works better for and your business
- Make it fun