February 2022
Intermediate to advanced
274 pages
6h 28m
English
The Cards source code is split into three layers: CLI, API, and DB. The CLI handles the interaction with the user. The CLI calls the API, which handles most of the logic of the application. The API calls into the DB layer (the database), for saving and retrieving application data. We’ll look at the structure of Cards more in Considering Software Architecture.
There’s a data structure used to pass information between the ClI and the API, a data class called Card:
| | @dataclass |
| | class Card: |
| | summary: str = None |
| | owner: str = None |
| | state: str = "todo" |
| | id: int = field(default=None, compare=False) |
| | |
| | @classmethod |
| | def from_dict(cls, d): |
| | return Card(**d) |
| | def to_dict ... |
Read now
Unlock full access