Skip to content

Commit e805cda

Browse files
author
szjanikowski
committed
Feedback from client onboarding
1 parent 1d79530 commit e805cda

2 files changed

Lines changed: 55 additions & 20 deletions

File tree

docs/configure.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,24 @@ sidebar_position: 3
66

77
Learn how to use Noesis DSL to set architectural patterns in your code, allowing Noesis to focus on key building blocks in your codebase.
88

9+
:::info Understanding the P3 Model is Key
10+
Understanding the [P3 model](https://github.com/NoesisVision/P3-model/blob/main/Elements.md) is crucial for effective Noesis configuration. The P3 model defines three key elements that form the foundation of how Noesis analyzes and visualizes your system architecture:
11+
- **[Domain Modules](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-module)** - logical groupings of related functionality
12+
- **[Domain Objects](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-object)** - key building blocks of your domain model
13+
- **[Domain Behaviors](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-behavior)** - operations or entry points in your system
14+
:::
15+
916
## Noesis DSL Description
1017

1118
Noesis DSL is a fluent API for configuring source code analysis. It consists of three main parts:
1219

1320
1. **System** - defines the name of the analyzed system
1421
2. **Repositories** - configures code sources (local or remote Git repositories)
15-
3. **Conventions** - defines conventions for domain modules, domain objects, and domain behaviors
22+
3. **Conventions** - defines conventions for [domain modules](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-module), [domain objects](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-object), and [domain behaviors](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-behavior)
23+
24+
:::info Important Note about Repositories
25+
The **Repositories** node in Noesis DSL refers to **version control repositories** (code repositories, Git repositories), not the Repository design pattern. This section configures where Noesis should look for your source code to analyze.
26+
:::
1627

1728
## Basic Configuration Examples
1829

@@ -69,7 +80,7 @@ public static FullAnalysisConfig Create() => FullAnalysisConfigBuilder
6980

7081
## Entry Points Configuration
7182

72-
Entry Points are a critical component of Noesis DSL configuration. The `NoesisTags.Domain.EntryPoint` tag is specially treated in the implementation and represents the main entry points into your system's business logic. These are typically methods that handle incoming requests, commands, or messages.
83+
Entry Points are a critical component of Noesis DSL configuration. The `NoesisTags.Domain.EntryPoint` tag is specially treated in the implementation and represents the main [domain behaviors](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-behavior) that serve as entry points into your system's business logic. These are typically methods that handle incoming requests, commands, or messages.
7384

7485
### Common Entry Points Patterns
7586

@@ -408,7 +419,7 @@ Configures a local Git repository for analysis:
408419
The AnalyzersBuilder configures how Noesis identifies and categorizes different elements in your codebase. It has three main configuration areas: domain modules, domain objects, and domain behaviors.
409420

410421
#### ForDomainModules
411-
Configures how domain modules are identified and created:
422+
Configures how [domain modules](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-module) are identified and created:
412423

413424
```csharp
414425
.ForDomainModules(convention => convention
@@ -418,7 +429,7 @@ Configures how domain modules are identified and created:
418429
.SkipNamespaceParts("Company", "Infrastructure")) // Remove common prefixes
419430
```
420431

421-
**Purpose:** Domain modules represent logical groupings of related functionality in your system. They're typically created from namespace hierarchy but can be filtered and customized.
432+
**Purpose:** [Domain modules](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-module) represent logical groupings of related functionality in your system. They're typically created from namespace hierarchy but can be filtered and customized.
422433

423434
**Configuration Methods:**
424435
- **UseNamespaceHierarchy**: Creates modules based on namespace structure
@@ -445,6 +456,12 @@ Configures how domain objects (entities, services, repositories, etc.) are ident
445456

446457
**Purpose:** Domain objects represent the key building blocks of your domain model. They can be tagged for categorization and filtering in the generated documentation.
447458

459+
:::info Important Note about Domain Objects
460+
**Domain Objects** in Noesis DSL can be **any objects from your code** - they are not limited to Domain Driven Design concepts. You can identify and tag various types of objects such as services, entities, repositories, commands, events, queries, controllers, or any other architectural components that are important in your system.
461+
462+
For more information about the generic P3 model and its elements, see the [P3 Model Elements documentation](https://github.com/NoesisVision/P3-model/blob/main/Elements.md).
463+
:::
464+
448465
**Configuration Methods:**
449466
- **UseTypes**: Analyzes types (classes, interfaces, etc.)
450467
- **OfKind**: Filters by type kind (Class, Interface, Enum, etc.)
@@ -453,7 +470,7 @@ Configures how domain objects (entities, services, repositories, etc.) are ident
453470
- **SetName**: Customizes the object name in documentation
454471

455472
#### ForDomainBehaviors
456-
Configures how domain behaviors (entry points, operations, etc.) are identified:
473+
Configures how [domain behaviors](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-behavior) (entry points, operations, etc.) are identified:
457474

458475
```csharp
459476
.ForDomainBehaviors(NoesisTags.Domain.EntryPoint, convention => convention
@@ -464,7 +481,7 @@ Configures how domain behaviors (entry points, operations, etc.) are identified:
464481
.WithName("Handle")) // Method name pattern
465482
```
466483

467-
**Purpose:** Domain behaviors represent operations or entry points in your system. They're typically identified by analyzing methods rather than entire types.
484+
**Purpose:** [Domain behaviors](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-behavior) represent operations or entry points in your system. They're typically identified by analyzing methods rather than entire types.
468485

469486
**Configuration Methods:**
470487
- **UseMethods**: Analyzes individual methods

docs/quick-start.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ sidebar_position: 1
77
This practical tutorial will walk you through configuring Noesis step by step. After completing it, you'll be able to **see** - "See how your system REALLY works" 🙂
88

99
What you should expect:
10-
- **Your system visualization** in the form of domain modules
10+
- **Your system visualization** in the form of [P3 model elements](https://github.com/NoesisVision/P3-model/blob/main/Elements.md)
1111
- **Entry points** contained in these modules - often corresponding to REST endpoints or business logic entry points
1212
- **Service visualization** showing which services are used by each entry point and how they're interconnected
1313

14+
:::info Understanding the P3 Model
15+
Understanding the [P3 model](https://github.com/NoesisVision/P3-model/blob/main/Elements.md) is crucial for effective Noesis configuration. The P3 model defines three key elements: **domain modules**, **domain objects**, and **domain behaviors** that form the foundation of how Noesis analyzes and visualizes your system architecture.
16+
:::
17+
1418
## Prerequisites
1519

1620
Before you begin, make sure you have:
@@ -86,7 +90,7 @@ Open your browser and navigate to `http://localhost:8088`. You should see the No
8690

8791
Now we'll configure Noesis to analyze your repository and make the full use of directory structure presented in [Step 1](#step-1-prepare-directory-structure).
8892

89-
Let's start by creating a basic configuration that will detect domain modules according to namespace hierarchy.
93+
Let's start by creating a basic configuration that will detect [domain modules](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-module) according to namespace hierarchy.
9094
In order to achieve that, you are going to configure two new volumes in the container:
9195
- `externalSources` - it is a root directory of all the code repositories you want to scan
9296
- `externalConfig` - is a path to a new .NET project where you will specify your scanning rules and architecture conventions, using Noesis DSL
@@ -124,7 +128,7 @@ cd noesis-config
124128
Now add .NET NuGet packages to the project and test that it compiles
125129

126130
``` bash
127-
dotnet add package NoesisVision.Configuration --prerelease
131+
dotnet add package NoesisVision.Configuration
128132
dotnet build
129133
```
130134

@@ -135,7 +139,7 @@ Open the project in your IDE and create the `ArchitectureConventions.cs` file.
135139
**Remember to change `../my-system-repo` to the actual path to your project.**
136140

137141
```csharp
138-
using Noesis.Parser.Configuration;
142+
using NoesisVision.Parser.Configuration;
139143

140144
namespace NoesisConfig
141145
{
@@ -154,6 +158,10 @@ namespace NoesisConfig
154158
}
155159
```
156160

161+
:::info Important Note about Repositories
162+
The **Repositories** node in Noesis DSL refers to **version control repositories** (code repositories, Git repositories), not the Repository design pattern. This section configures where Noesis should look for your source code to analyze.
163+
:::
164+
157165
Play with the DSL if you want. You should be able additional versions of methods e.g. allowing to specify repository branch (which might be useful if your primary branch is not `main`). You may add multiple configuration files - they will be recognized by Noesis as separate systems to scan.
158166

159167
Check if the project correctly compiles - otherwise Noesis won't be able to work with it.
@@ -205,18 +213,23 @@ docker run \
205213
[10:05:15 INF] Inferencing finished in 0.06s.
206214
[10:05:15 INF] Full analysis for system DDD Starter Dotnet finished in 62.92s.
207215
```
216+
:::warning
217+
You may see some compilation errors in the logs - DO NOT PANIC - probably these are compilation WARNINGS which are only displayed as errors by Roslyn. Please wait patientily for the final message about success or failure of project loading.
218+
:::
208219
3. Go back to the main page and click "Basic mode" to view the scan results. Choose your result.
209220
4. Click **Modules** view - you should see modules created from your project's namespaces in the tree on the left, after you expand it. Here's how it may look:
210221
211222
![Modules tree view](/img/modules.png)
212223
213224
214225
226+
227+
215228
🎉 **Second Success!** Noesis recognized your system structure and created domain modules.
216229
217230
## Step 5: Entry Points Configuration
218231
219-
Now we'll add entry points configuration - entry points to your system's business logic. These often correspond to REST API endpoints or command handling methods.
232+
Now we'll add entry points configuration - [domain behaviors](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-behavior) that represent entry points to your system's business logic. These often correspond to REST API endpoints or command handling methods.
220233
221234
:::info
222235
From now on, it might be worth knowing that **the architecture conventions examples presented in the code-snippets below were created according to the architecture of an opensource project [Grandnode2](https://github.com/grandnode/grandnode2)**. This information might help you compare what is the exact application code corresponding to the presented usages of Noesis DSL. In addition you can find a full configuration for this projects in our examples repository on [Github](https://github.com/NoesisVision/noesis-config)
@@ -227,15 +240,15 @@ From now on, it might be worth knowing that **the architecture conventions examp
227240
Update `ArchitectureConventions.cs`, adding entry points configuration. The configuration depends on your project patterns, but if you use typical `CommandHandlers` with method `Handle` it may look like that:
228241
229242
```csharp
230-
using Noesis.Parser.CodeParsing.Configuration;
231-
using Noesis.Parser.Configuration;
232-
using Noesis.Tags;
243+
using NoesisVision.Parser.CodeParsing.Configuration;
244+
using NoesisVision.Parser.Configuration;
245+
using NoesisVision.Tags;
233246
234247
namespace NoesisConfig
235248
{
236249
public static class Grandnode2Config
237250
{
238-
[FullAnalysisConfigAttribute]
251+
[FullAnalysisConfigAttribute]
239252
public static FullAnalysisConfig Create() => FullAnalysisConfigBuilder
240253
.System("My System") // System name in documentation
241254
.Repositories(repositories => repositories
@@ -288,16 +301,16 @@ Here's how it may look:
288301

289302
## Step 6: Services Configuration
290303

291-
Finally, we'll add services configuration - business components used by entry points.
304+
Finally, we'll add services configuration - [domain objects](https://github.com/NoesisVision/P3-model/blob/main/Elements.md#domain-object) that represent business components used by entry points.
292305

293306
### 6.1: Add Services Configuration
294307

295308
Update `ArchitectureConventions.cs`, adding services configuration:
296309

297310
```csharp
298-
using Noesis.Parser.CodeParsing.Configuration;
299-
using Noesis.Parser.Configuration;
300-
using Noesis.Tags;
311+
using NoesisVision.Parser.CodeParsing.Configuration;
312+
using NoesisVision.Parser.Configuration;
313+
using NoesisVision.Tags;
301314

302315
namespace NoesisConfig
303316
{
@@ -328,9 +341,14 @@ namespace NoesisConfig
328341
.Build();
329342
}
330343
}
331-
332344
```
333345

346+
:::info Important Note about Domain Objects
347+
**Domain Objects** in Noesis DSL can be **any objects from your code** - they are not limited to Domain Driven Design concepts. You can identify and tag various types of objects such as services, entities, repositories, commands, events, queries, controllers, or any other architectural components that are important in your system.
348+
349+
For more information about the generic P3 model and its elements, see the [P3 Model Elements documentation](https://github.com/NoesisVision/P3-model/blob/main/Elements.md).
350+
:::
351+
334352
### 6.2: Run with Full Configuration
335353

336354
Run the container with complete configuration:

0 commit comments

Comments
 (0)