Skip to content

Commit

Permalink
docs: init page on blog posts
Browse files Browse the repository at this point in the history
  • Loading branch information
tassiluca committed Jan 12, 2024
1 parent b9d6d8e commit e71c530
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ Analyze aspects such as:
## Roadmap

1. [Boundary and break](./docs/boundaries)
2. [Blog posts service example: a direct-style vs monadic comparison](./docs/blog-posts-service)

TBD
37 changes: 37 additions & 0 deletions docs/content/docs/blog-posts-service.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Blog posts service example: a direct-style vs monadic comparison

## The need for a new `Future` construct

The current implementation of the `Future` monadic construct suffers the following main cons:

- Lack of **referential transparency**
- Lack of **cancellation** mechanisms (and _structured concurrency_)
- **Accidental Sequentiality**

## Example: a blog posts service

> **Idea**: develop a very simple (mocked) service which allows to store and retrive from a repository blog posts, as well as perform some checks before the actual storage.
The example has been implemented using:

- the current Scala `Future` constructs;
- the mechanism abstractions offered by `gears`;
- Kotlin.

The sources are available in the `posts` package of both Kotlin and Scala main folders.

### Structure

#### Scala

Uses Cake Pattern:

- `PostsRepositoryComponent`
- is the component exposing the `Repository` trait allowing to store and retrieve blog posts;
- mocking a DB technology with an in-memory collection
- `PostsServiceComponent`
- is the component exposing the `Service` interface.

Both the components must be designed in an async way.

### 1st version: current Future monadic
6 changes: 6 additions & 0 deletions docs/content/menu/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
headless: true
---

- [Boundary & Break]({{< relref "/docs/boundaries" >}})
- [Blog posts service example]({{< relref "/docs/blog-posts-service" >}})
1 change: 1 addition & 0 deletions docs/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ enableGitInfo = true # to enable 'Last Modified by' date and git author informat
BookTheme = 'auto'
BookRepo = 'https://github.com/tassiLuca/PPS-22-direct-style-experiments' # used for 'Last Modified' and 'Edit this page' links
BookCommitPath = 'commit'
BookMenuBundle = '/menu'

0 comments on commit e71c530

Please sign in to comment.