-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First stage of implementation #1
Conversation
README.md
Outdated
- describe the architecture as code and store it in a Git repository; | ||
- set up versioning and sharing of the architecture, for example, using NuGet packages; | ||
- create a project in the service to test its architecture; | ||
- add the architecture package and the `Byndyusoft.ArchitectureTesting.StructurizrParser` package to the project; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the architecture package
что за пакет? из описания не понятно
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавил описание
autolayout lr | ||
} | ||
|
||
container storage { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Форматирование?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, поудалял табы.
dotnet add package Byndyusoft.ArchitectureTesting.StructurizrParser | ||
``` | ||
|
||
## Usage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Описалово слабое. Я совсем не понял как работает процесс в целом и почему я должен писать свой валидатор.
Новичкам будет сложно.
Непонятно что писать в валидаторе, непонятно что писать в тесте.
В общем не хватает идеи за счёт чего происиходит тестирование архитектуры.
Типа "сравниваем описание архитектуры с .....", а вот с чем сравниваем непонятно.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно обсудить на уровне концепции. Мне кажется, что компарить клиент не должен. Он должен сделать поставщик зависимостей, а сравнить и ругнуться должна инфра.
Просто вот у меня есть пакет с архитектурой, я его подключил... и как мне понять, что я не соответствую архитектуре?
Я думал, меня будут мучать, пока я её не удовлетворю.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавил описание концепции
public void Dispose() | ||
{ | ||
Dispose(true); | ||
GC.SuppressFinalize(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь нет неуправляемых ресурсов, финазатор гасить не нужно
void Dispose(bool disposing) - тоже не нужен
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделано
/// <returns>Список выявленных проблем</returns> | ||
public IEnumerable<string> Validate(ServiceContract contract, ServiceImplementation implementation) | ||
{ | ||
var dependenciesByValidators = _dependencyValidators.Values.ToDictionary(x => x, _ => new List<DependencyBase>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Разве там можно? в ключе наследник IDependencyValidator и у него нет компарера. Словарь будет работать по сравнению ссылки объекта. Как-то не круто.
Могут ли валидаторы повторяться для разных типов?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Согласен, я бы тоже лучше создал словарь _dependenciesByDependencyType, а в конце доставал бы валидатор по типу ) так опасно
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Переделал кусок, попутно добавил ServiceValidationConfiguration
для возможности игнорирования определенных типов зависимостей
src/Abstractions/Validation/Extensions/AssemblyNameExtensions.cs
Outdated
Show resolved
Hide resolved
/// <returns>Список выявленных проблем</returns> | ||
public IEnumerable<string> Validate(ServiceContract contract, ServiceImplementation implementation) | ||
{ | ||
var dependenciesByValidators = _dependencyValidators.Values.ToDictionary(x => x, _ => new List<DependencyBase>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Согласен, я бы тоже лучше создал словарь _dependenciesByDependencyType, а в конце доставал бы валидатор по типу ) так опасно
…er was described in use case
No description provided.