- Contributing to Visual tangible artefacts
- Naming Conventions
- Issue Creation and Branching:
-
When adding new features, create an issue on GitHub to track the feature or bug fix.
-
Create a new branch from the issue and use that branch for development.
-
Once development is complete, submit a pull request and pull it to main*.
-
If unsure about code validity, assign a code reviewer.
*It might be easier for you to pull main, into the feature branch, testing it, and then pulling feature to main
-
We follow a DB-first approach for this project. This means that the database schema is designed first, and the code is generated based on that schema. Changes to the database structure are reflected in the application via code generation tools (e.g., Entity Framework for C# or other ORM frameworks).
- Workflow:
-
Database schema design: Define tables, columns, relationships, and constraints in the database.
-
Generate models: Use dotnets tools to generate model classes and mappings based on the existing database using
dotnet ef dbcontext scaffold "server=[server];port=[port];user=[user];password=[password];database=VTA" Pomelo.EntityFrameworkCore.MySql -o scaffold -f
for the entire database. -
Migrations: When changes to the schema are required, update the database first, then regenerate the models using
dotnet ef dbcontext scaffold "server=[server];port=[port];user=[user];password=[password];database=VTA" Pomelo.EntityFrameworkCore.MySql -o scaffold --table [Table1] --table [Table2] -f
for only specific tables. -
Code generation: Ensure consistency between the database and the code by regenerating models after every schema update. *These commands are configured to output to the folder
scaffold
.**The autogenerated DBContext contains every single "table" from the DBcontext, this however, can impact concurrency, therefore we split it up, if you are unsure about how to, reffer to the existing DBContexts
-
- Classes, Enums, Typedefs, and Type Parameters: Use
PascalCase/UpperCamelCase
.class SliderMenu { ... } typedef Predicate<T> = bool Function(T value);
- Extensions: Use
PascalCase/UpperCamelCase
.extension MyFancyList<T> on List<T> { ... }
- Variables, Functions, Parameters, and Named Constants: Use
camelCase/lowerCamelCase
.var itemCount = 3; void alignItems(bool clearItems) { ... }
- Directories and Files: Use
lowercase_with_underscores
.lib/ my_widget.dart utils/ string_helpers.dart
- Import Prefixes: Use
lowercase_with_underscores
.
- Acronyms and Abbreviations: Capitalize acronyms and abbreviations longer than two letters like words.
class HttpRequest { ... } ``
Use dart format
to format your code
For other formatting guidlines refer to dart.dev styling guidlines
- Classes, Enums, and Structs: Use
PascalCase
.class MyClass { ... } enum Colors { Red, Green, Blue }
- Methods, Properties, and Events: Use
PascalCase
.public void FetchData() { ... } public string Name { get; set; }
- Variables and Parameters: Use
camelCase
.int itemCount = 3; void SetItemCount(int itemCount) { ... }
- Constants: Use
PascalCase
with theconst
modifier.const int MaxItems = 10;
- Interfaces: Prefix with an "I" and use
PascalCase
.public interface IMyInterface { ... }
- Namespaces: Use
PascalCase
.namespace MyApplication.Data { // ... }
- Files: Each file should contain a single class, interface, or enum, named after the type it contains. Use
PascalCase
for file names.MyClass.cs IMyInterface.cs Colors.cs
- Acronyms: Capitalize acronyms. For longer acronyms, use
PascalCase
.class IOHandler { ... } class HttpRequest { ... }
- Use a consistent style for code formatting. Refer to the official C# Coding Conventions.
- Document your code using comments (
///
). Refer to Microsoft documentation guidelines.