Homework 2
Learning Objectives
In this homework, you will apply the concepts you learned from the textbook and class to reinforce your understanding of:
- Decomposing requirements into components and connectors.
- Use of software architecture patterns and styles.
- Prescriptive architecture.
- Stable Dependencies Principle.
Description
In class, we discussed the Pedometer application case study, which was a web application that relied on manual input of the acceleration data. We also discussed the possibility of converting this application into a native mobile app. We discussed the trade-offs between making this a native app that runs entirely on the mobile device versus a web application. It is now time to design an architecture for this application.
Before we design an architecture, it is important to understand the requirements of this application. Requirements below are stated in the form of "user stories".
- As an app user, I would like to know my step count for the current day as well as historical step count, so that I could track my activity.
- As an app user, I would like to know how many calories I am burning by walking (for the current day and historically), so that I could set exercise goals.
- As an app user, I would like to see charts showing my last 12 months step count (aggerated per month) and average per-day-of-week step count, so I can analyze my walking habits.
- As an app user, I would like the ability to clear all my historical statistics, so that I could have a fresh start.
- As a developer, I would like to track which application features are the most popular with the users (if the user agrees to sharing this information), so that I could remove unused features and make popular features more prominent.
Getting Started
In the pedometer
directory of your git repos, create an architecture
subdirectory. The pedometer/architecture
directory will be referred to as project directory.
Your assigment is to architect a solution that can be used to implement these user stories. The various design patterns you studied in Chapter 4 may be a good place to start. In your architecture, you need to define:
- Components: Specify the components of your application and document detailed functionality that each component encapsulates. In the project directory, create a text file for each compponent. At the top of each component's text file, describe the functionality of that component (if you would like, instead of text files, you can use git markdown .md files).
- Connectors: Decide how the components will be connected and sketch out the details of these connections. For example, if the components will connect to each other via an API, specify the various API functions and data that is passed to and returned from the API. Add all API details to the appropriate components' file. If your components communicate via shared data, add a text file for the shared data and provide the details there. Each connector should either be speecified in a component's file or in its own file.
- Stable Dependencies Principle: Draw a dependency diagram and make sure your solution follows the Stable Dependencies Principle that we discussed in class. Your dependency diagram should go into the README.md file of the project directory (hand drawn diagrams will be accepted, just snap a picture of them and include them in the README.md).
- Requirements: For each user story, describe the information flow and interactions between the components to satisfy the requirements of the story. This should be included in the README.md file in the project directory: add a subsection for each requirment, state the requirement, and describe the how your architecture will satisfy that requirement.
Note: do not assume any particular programming language for this architectural view.
Submitting Your Solution
Submit your solution by commiting all the required files to the master branch of your git repos and pushing your commits to the gitlab server.
Grading
Your grade will be based on the completeness and thoroughness of your solution. A complete solution addresses the four required sections of this homework: Components, Connectors, Stable Dependencies Principle, and Requirements. A thorough solution gives a level of details that can be handed over to a team of developers for implementation. Homework 1 is worth 100 points, evenly divided among the four sections (25 points each).