Intro (5 minutes)
As you learned to build more complex applications, we gave you Rails. As a framework, one of Rails’ jobs is to help you organize your code. Logic that is related to a resource belongs in that resource’s model. Logic related to a view belongs in a helper.
This doesn’t just help you organize your files – it helps you organize divide responsibilities in your code.
By the end of this workshop, you should be able to:
- Understand Murphy’s Four Areas of Responsibility
- Come up with a file structure to organize your client-side JS
After 15 minutes, turn to the person next to you and compare/discuss interesting parts of the reading.
Murphy’s Four Areas of Responsibility
- Presentation and interaction
- Data management and persistence
- Overall application state
- Setup and glue code to make the pieces work together
Activity (10 minutes)
Pair up with your QS partner. With the Four Areas of Responsibility in mind along with projects specs, come up with a file structure you could use to organize your project. Be prepared to show this to the class.
Review (20 minute)
Have each group show the file structures they have come up with.
- Compare and contrast.
- What are some similarities we are seeing?
- What are some differences?
- Should we all be using similar structures? What does that look like?