HTTP Method | Description | Resource | Success Code | Failure Code |
---|---|---|---|---|
POST | Solve sudoku | api/v1/sudoku/solve | 200 | 400 |
POST | Sudoku solution hint | api/v1/sudoku/hint | 200 | 400 |
POST | Sudoku verify solution | api/v1/sudoku/verify | 200 | 400 |
GET | Generate sudoku | api/v1/sudoku/generate | 200 |
View
Views are the touching points for users, they receive user input and displays output. A View is considered "dumb" (presentational) and does not contain any application logic.
When a user interacts with a View events are triggered and passed on to a ViewController. A View will then change its visual state based on the response from the ViewController.
Views should only be used for displaying data and may contain related subviews.
ViewController
A ViewController controls a View and its subviews, i.e. SudokuBoardView
with the subview SudokuCellView
. The ViewController is smart and contains all View related logic. ViewControllers work as the "glue" between the application and what users see on the screen.
The ViewControllers resides between the Views and the ViewModels.
A View is never aware of any ViewModels. Events like user inputs are not passed directly from the View to a ViewModel, they get passed to a ViewController which in turn prepares the data and passes it on to the ViewModel.
A ViewController can reference many different ViweModels.