Architecture Guidelines
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 20/100
- Type d'issue
- Documentation
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- csharp
- Domaine
- documentation
Piste de recherche
Commencez par examiner le README et les documents existants de directives de codage dans le dépôt, puis comparez-les aux sections proposées Project documentation, General Architecture et Web Application Architecture. L’issue ne nomme aucun fichier et ne définit pas de périmètre convenu ; sa résolution nécessiterait un ensemble de directives accepté et exploitable, ainsi qu’un emplacement clairement défini pour celles-ci.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- C#
- Étoiles
- 12
- Forks
- 16
- Merge moyen
- 2 min
- PR mergées (30 j)
- 7
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de IntelliTect/CodingGuidelines
-
Overriding ToString() Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 25/100
IntelliTect/CodingGuidelines#290 ·
-
proposal: ban List<T>.ForEach Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
IntelliTect/CodingGuidelines#253 ·
-
.editorconfig C# coding guidelines proposal
IntelliTect/CodingGuidelines#249 · 6 commentaires · 1 réaction · 2 personnes assignées ·
-
INTL0001 when using records Ouverteanalyzer C# coding guidelines proposal
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
IntelliTect/CodingGuidelines#231 ·
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
IntelliTect/CodingGuidelines#230 ·
Toutes les issues de IntelliTect/CodingGuidelines
Issues similaires
-
core dependencies
Difficulté 1/5 Moins d'une heure Accessibilité débutants 80/100
-
bug frontend good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
NavigationViewItemAutomationPeer implements IInvokeProvider but never advertises the Invoke pattern Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
unoplatform/uno#24629 ·
-
agentic-workflows Needs: Triage :mag: State: In-PR
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Down / Waiting for removal
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100