Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Domain-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### Exercise

Follow the same process as above to translate these two user stories into domain models.

```
As a supermarket shopper,
So that I can pay for products at checkout,
I'd like to be able to know the total cost of items in my basket.
```
| Classes | Methods | Scenario | Outputs |
|-----------|--------------------------------------|-----------------|---------|
| `Product` | `Product(String name, double price)` | Create product | |
| `Basket` | `Add(Product)` | Add to basket | |
| | `GetItems()` | Get items | |
| | `GetTotalPrice()` | Calculate total | Double |


```
As an organised individual,
So that I can evaluate my shopping habits,
I'd like to see an itemised receipt that includes the name and price of the products
I bought as well as the quantity, and a total cost of my basket.
```
| Classes | Methods | Scenario | Outputs |
|-----------|-------------------------------------|-----------------|---------|
| `Product` | `Product(String name, double price)` | Create product | |
| `Basket` | `Add(Product, int quanity)` | Add to basket | |
| | `GetTotalPrice()` | Calculate total | Double |
| | `ItemizeProduct()` | | |
3 changes: 2 additions & 1 deletion EXERCISE1.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

### Warm up

A **User Story** describes one thing a program is expected to do, from the perspective of somebody using that program. When planning a program, the client's requirements will be decomposed into many User Stories. Much of a developer's life is spent translating User Stories into a functional system. These systems are made up of different components, and each component is made up of units. We call these systems **Domain Models**.
A **User Story** describes one thing a program is expected to do, from the perspective of somebody using that program.
When planning a program, the client's requirements will be decomposed into many User Stories. Much of a developer's life is spent translating User Stories into a functional system. These systems are made up of different components, and each component is made up of units. We call these systems **Domain Models**.

There are various different formats for user stories but they all share a common goal: describe a feature the user wants. Here's one style of user story:

Expand Down