Architecture Guidelines
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 20/100
- Tipo de issue
- Documentação
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- csharp
- Domínio
- documentation
Direção de pesquisa
Comece revisando o README e os documentos existentes de diretrizes de codificação no repositório e, em seguida, compare-os com as seções propostas Project documentation, General Architecture e Web Application Architecture. A issue não nomeia arquivos nem define um escopo acordado; para considerá-la concluída, seria necessário um conjunto de diretrizes aceito e acionável, além de um local claro para elas.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Some proposals for guidelines based on things I've seen recently, and over the years:
Project documentation:
-
All projects should have a README file in their repository root that includes the following information, or contains links or instructions on where to find the following information:
- How to setup a local development environment for working on the project, including:
- Prerequisite installed software (IDEs, SDKs, Databases, other tooling, recommended IDE extensions, etc.), including version requirements.
- How to open the project in the recommended IDE/editor (e.g. "Open the .sln file in the repository root with Visual Studio 2019")
- How to build and run the project, including:
- How to restore any packages that aren't automatically restored. For example, Nuget packages are auto-restored by
dotnettooling, butnpmpackages are not. - How to obtain a local copy of any required database, if necessary.
- How to restore any packages that aren't automatically restored. For example, Nuget packages are auto-restored by
- How to run the project's tests
- How to contribute to the project's tests, including a brief summary of the different types of testing that are utilized in the application (unit testing, integration testing, UI testing, etc).
- How to contribute changes to the primary branch of the project, including a description of branching strategy, the project's pull request process & requirements, any review processes the project is subject to, including code reviews, architecture review, security reviews, etc.
- How the project is deployed, including:
- A description of each environment that the project may be deployed to
- Any URL(s) where the deployed/published project may be found
- A description of the process for promotion from one environment to another, including necessary approvals, manual testing/verification, and actual actions that must be taken to achieve the environment promotion (e.g. release pipelines).
- How to setup a local development environment for working on the project, including:
-
All possible sources of application configuration that is environment-dependent MUST be clearly enumerated in a README file in the root of the project's repository, or must otherwise be linked to from such a README file. This file MUST be updated when changes are made to how an application is configured.
- Possible sources of configuration include, but are not limited to:
- Injection by an automated build or release process
- Stored on a cloud service, such as Azure App Service configuration (injected into the app via Environment Variables), or Azure Key Vault
- Stored in database table(s)
- Stored in files checked into the repository, including appsettings.*.json, launchSettings.json, package.json, app.config, and any other file containing configuration.
- Stored from predefined files/directories in environments where the application is running.
- Hardcoded configuration (DO NOT use hardcoded configuration, but if it truly cannot be moved elsewhere, please document it.)
- Possible types of configuration include, but are not limited to:
- Any credentials, including username/password pairs and API keys
- Any configuration the instructs the application how to locate an external resource, including database connection strings, URLs, IP addresses, email addresses, cloud provider subscription IDs, resource IDs, or any other external resource.
- Possible sources of configuration include, but are not limited to:
General Architecture:
- Utilize Dependency Injection in all projects whenever possible This probably needs to be expanded upon - its maybe too open-ended and vague
- In projects utilizing dependency injection:
- DO NOT store global singletons in static fields/properties. Always resolve such objects from the DI container, including services, configuration, or any other singleton.
- DO NOT manually instantiate classes that are registered with the DI container. This is especially applicable to Entity Framework
DbContextinstances, because manual instantiation implies that theDbContextOptions<>are also being manually created, are hardcoded into theDbContextconstructor, or are being stored as a global singleton.- Exception: Instantiating
DbContextinstances during setup when the instance is being configured with some an in-memory provider.
- Exception: Instantiating
- AVOID using the service locator pattern, PREFER using the standard mechanisms of injection provided by your DI framework (e.g. constructor injection, ASP.NET Core parameter injection via
[FromServices], etc.)
Web Application Architecture:
- When an application needs to run long-running or recurring background jobs, you SHOULD prefer Hangfire (https://www.hangfire.io/) over homegrown out-of-process job engines, manual spawning of threads, using
Task.Run, or utilizing a cloud-native solution.- Exceptions may be made if:
- The principal purpose of the web application is to spawn, facilitate, manage, execute, or monitor such background jobs, or
- Running background jobs in the same process as the web application will cause significant performance, stability, or security issues.
- Exceptions may be made if:
- DO NOT write business logic in controller classes. DO write business logic in service classes that do not have any concerns or knowledge of web requests & responses. Such classes can be directly tested with unit tests, can be easily called from other services classes to facilitate code re-use and consistency.
- Linguagem predominante
- C#
- Estrelas
- 12
- Forks
- 16
- Merge médio
- 2min
- PRs com merge (30d)
- 10
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de IntelliTect/CodingGuidelines
-
Overriding ToString()Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 25/100
IntelliTect/CodingGuidelines#290 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 45/100
IntelliTect/CodingGuidelines#253 ·
Mantenedores costumam responder em até 1 dia
-
Review naming recommendation for fieldsTalvez livre de novo @MarkMichaelis assumiu há 1320 dias e não há nenhum pull request aberto. Aberta.editorconfig C# coding guidelines proposal
IntelliTect/CodingGuidelines#249 · 6 comentários · 1 reação · 2 responsáveis ·
Mantenedores costumam responder em até 1 dia
-
INTL0001 when using recordsAbertaanalyzer C# coding guidelines proposal
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
IntelliTect/CodingGuidelines#231 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
IntelliTect/CodingGuidelines#230 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de IntelliTect/CodingGuidelines
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
microsoft/fluentui-blazor#5364 ·
Mantenedores costumam responder em até 1 dia
-
.NET triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
microsoft/agent-framework#8811 ·
Mantenedores costumam responder em até 1 dia
-
.NET Docs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
getsentry/sentry-dotnet#5637 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
QuantConnect/Lean#9842 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
NethermindEth/nethermind#14012 ·
Mantenedores costumam responder em até 1 dia