Skip to content

Commit

Permalink
fix: change order of layer descriptions (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
Efim-Kapliy committed May 4, 2024
1 parent 11e4b18 commit 16f635c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ In FSD, a project consists of <mark>layers</mark>, each layer is made up of <mar

![themed--scheme](/img/visual_schema.jpg)

The **layers** are standardized across all projects and vertically arranged. Modules on one layer can only interact with modules from the layers strictly below. There are currently seven of them (bottom to top):

1. `shared` — reusable functionality, detached from the specifics of the project/business.
<small>(e.g. UIKit, libs, API)</small>
2. `entities` — business entities.
<small>(e.g., User, Product, Order)</small>
3. `features` — user interactions, actions that bring business value to the user.
<small>(e.g. SendComment, AddToCart, UsersSearch)</small>
The **layers** are standardized across all projects and vertically arranged. Modules on one layer can only interact with modules from the layers strictly below. There are currently seven of them (from top to bottom):

1. `app` — app-wide settings, styles and providers.
2. `processes` (deprecated) — complex inter-page scenarios.
<small>(e.g., authentication)</small>.
3. `pages` — compositional layer to construct full pages from entities, features and widgets.
4. `widgets` — compositional layer to combine entities and features into meaningful blocks.
<small>(e.g. IssuesList, UserProfile)</small>
5. `pages` — compositional layer to construct full pages from entities, features and widgets.
6. `processes` (deprecated) — complex inter-page scenarios.
<small>(e.g., authentication)</small>
7. `app` — app-wide settings, styles and providers.
<small>(e.g. IssuesList, UserProfile)</small>.
5. `features` — user interactions, actions that bring business value to the user.
<small>(e.g. SendComment, AddToCart, UsersSearch)</small>.
6. `entities` — business entities.
<small>(e.g., User, Product, Order)</small>.
7. `shared` — reusable functionality, detached from the specifics of the project/business.
<small>(e.g. UIKit, libs, API)</small>/.


Then there are **slices**, which partition the code by business domain. This makes your codebase easy to navigate by keeping logically related modules close together. Slices cannot use other slices on the same layer, and that helps with high cohesion and low coupling.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ FSD подходит для проектов и команд любого раз

![themed--scheme](/img/visual_schema.jpg)

**Слои** стандартизированы во всех проектах и расположены вертикально. Модули на одном слое могут взаимодействовать лишь с модулями, находящимися на слоях строго ниже. На данный момент слоев семь (снизу вверх):

1. `shared` — переиспользуемый код, не имеющий отношения к специфике приложения/бизнеса.
<small>(например, UIKit, libs, API)</small>
2. `entities` (сущности) — бизнес-сущности.
<small>(например, User, Product, Order)</small>
3. `features` (фичи) — взаимодействия с пользователем, действия, которые несут бизнес-ценность для пользователя.
<small>(например, SendComment, AddToCart, UsersSearch)</small>
4. `widgets` (виджеты) — композиционный слой для соединения сущностей и фич в самостоятельные блоки
**Слои** стандартизированы во всех проектах и расположены вертикально. Модули на одном слое могут взаимодействовать лишь с модулями, находящимися на слоях строго ниже. На данный момент слоев семь (сверху вниз):

1. `app` — настройки, стили и провайдеры для всего приложения.
2. `processes` (процессы, устаревший слой) — сложные сценарии, покрывающие несколько страниц.
<small>(например, авторизация)</small>.
3. `pages` (страницы) — композиционный слой для сборки полноценных страниц из сущностей, фич и виджетов.
4. `widgets` (виджеты) — композиционный слой для соединения сущностей и фич в самостоятельные блоки.
<small>(например, IssuesList, UserProfile)</small>.
5. `pages` (страницы) — композиционный слой для сборки полноценных страниц из сущностей, фич и виджетов.
6. `processes` (процессы, устаревший слой) — сложные сценарии, покрывающие несколько страниц.
<small>(например, авторизация)</small>
7. `app` — настройки, стили и провайдеры для всего приложения.
5. `features` (фичи) — взаимодействия с пользователем, действия, которые несут бизнес-ценность для пользователя.
<small>(например, SendComment, AddToCart, UsersSearch)</small>.
6. `entities` (сущности) — бизнес-сущности.
<small>(например, User, Product, Order)</small>.
7. `shared` — переиспользуемый код, не имеющий отношения к специфике приложения/бизнеса.
<small>(например, UIKit, libs, API)</small>.

Затем есть **слайсы**, разделяющие код по предметной области. Они группируют логически связанные модули, что облегчает навигацию по кодовой базе. Слайсы не могут использовать другие слайсы на том же слое, что обеспечивает высокий уровень [_связности_][refs-wiki-cohesion] (cohesion) при низком уровне [_зацепления_][refs-wiki-coupling] (coupling).

Expand Down

0 comments on commit 16f635c

Please sign in to comment.