Skip to content
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

Best practices added + coding guidelines moved #3695

Merged
merged 4 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions develop/best_practices/Best_practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ In this section:

- [Unit testing](xref:Unit_testing)
- [XML documentation comments](xref:Xml_Documentation_Comments)

> [!TIP]
> See also:
>
> - [Best practices for protocol development](xref:CodingGuidelines)
> - [Best practices for Automation script development](xref:Automation_best_practices)
11 changes: 0 additions & 11 deletions develop/codingguidelines/AdminMetadata/CODAdminMetadata.md

This file was deleted.

11 changes: 0 additions & 11 deletions develop/codingguidelines/Attention/CODAttention.md

This file was deleted.

27 changes: 6 additions & 21 deletions develop/codingguidelines/CodingGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,13 @@
uid: CodingGuidelines
---

# DataMiner Protocol Development Guidelines
# Best practices for protocol development

The guidelines specified in this section are designed to uphold the level of quality of DMS protocols by improving readability, maintainability, and performance.
This section lists best practices and guidelines designed to uphold the quality level of DataMiner protocols (a.k.a. connectors) by improving readability, maintainability, and performance.

By adhering to these guidelines, we can ensure that protocols have a consistent look, and thereby increase maintainability and readability. The guidelines also increase reusability, stability and performance.
By adhering to these best practices and guidelines, you can ensure that protocols have a consistent look and thereby increase maintainability and readability, and you will also increase the reusability, stability, and performance of the protocols you develop.

When a new protocol version is created, you must verify every item in the protocol development checklist and specify "OK", "Fail" or "NA" every time.
A checklist is available [on DataMiner Dojo](https://community.dataminer.services/protocol-development-downloads/), which should be used whenever a new protocol version is created. In the checklist, verify every item and specify "OK", "Fail", or "NA", as appropriate.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 (see <https://www.ietf.org/rfc/rfc2119.txt>).

In this section:

- [General](xref:CODGeneral#general)

- [Administrative metadata](xref:CODAdminMetadata#administrative-metadata)

- [User interface](xref:CODUserInterface#user-interface)

- [Monitoring](xref:CODMonitoring#monitoring)

- [Protocol](xref:CODProtocol#protocol)

- [Validation](xref:CODValidation#validation)

- [Points of attention](xref:CODAttention#points-of-attention)
> [!NOTE]
> The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this section are to be interpreted as described in RFC 2119 (see <https://www.ietf.org/rfc/rfc2119.txt>).
17 changes: 0 additions & 17 deletions develop/codingguidelines/General/CODGeneral.md

This file was deleted.

41 changes: 0 additions & 41 deletions develop/codingguidelines/General/C_code_conventions.md

This file was deleted.

9 changes: 0 additions & 9 deletions develop/codingguidelines/General/Formatting.md

This file was deleted.

13 changes: 0 additions & 13 deletions develop/codingguidelines/General/ID_values.md

This file was deleted.

17 changes: 0 additions & 17 deletions develop/codingguidelines/General/Names.md

This file was deleted.

11 changes: 0 additions & 11 deletions develop/codingguidelines/Monitoring/CODMonitoring.md

This file was deleted.

9 changes: 0 additions & 9 deletions develop/codingguidelines/Protocol/API.md

This file was deleted.

25 changes: 0 additions & 25 deletions develop/codingguidelines/Protocol/CODProtocol.md

This file was deleted.

11 changes: 0 additions & 11 deletions develop/codingguidelines/Protocol/DVE.md

This file was deleted.

13 changes: 0 additions & 13 deletions develop/codingguidelines/Protocol/Logic1.md

This file was deleted.

9 changes: 0 additions & 9 deletions develop/codingguidelines/Protocol/Parameters3.md

This file was deleted.

27 changes: 0 additions & 27 deletions develop/codingguidelines/Protocol/QActions.md

This file was deleted.

12 changes: 11 additions & 1 deletion develop/codingguidelines/Protocol/Saving_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@ uid: Saving_parameters

# Saving parameters

- Parameters must only be saved when necessary. When a parameter is saved, it is saved in the database, leading to additional processing and memory usage.
To make sure your on-premises databases remain in good shape and do not get cluttered with unnecessary data, or to ensure a cost-efficient solution in case you make use of Storage as a Service, it is important to avoid storing unnecessary data. As a consequence, parameters must only be saved when this is really necessary.

Here are some things you can do to make sure no more data is saved than necessary:

- Only add a [save](xref:Protocol.Params.Param-save) attribute to a parameter if it is really necessary.

- If you know a parameter will change frequently, but it definitely needs to be saved, specify a [saveInterval](xref:Protocol.Params.Param-saveInterval) attribute.

- By default, the keys of a table are saved. Avoid fully cleaning and repopulating a table when updating values.

- Consider using a [volatile table](xref:AdvancedDataMinerDataPersistencePersistingTables#volatile-tables). Table that do not contain any monitored parameters could be a good fit for this.
5 changes: 2 additions & 3 deletions develop/codingguidelines/Protocol/StyleCop.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ uid: StyleCop

# StyleCop

- StyleCop does not indicate any warnings. For an overview of the StyleCop rules that need to be adhered to, refer to [C code conventions](xref:C_code_conventions).
- StyleCop does not indicate any warnings. For an overview of the StyleCop rules that need to be adhered to, refer to [C code conventions](xref:General_COD).

> [!TIP]
> See also:
> <https://github.com/Visual-Stylecop/Visual-StyleCop/wiki>
> See also: <https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/DOCUMENTATION.md>
17 changes: 0 additions & 17 deletions develop/codingguidelines/Protocol/Tables1.md

This file was deleted.

15 changes: 0 additions & 15 deletions develop/codingguidelines/Protocol/Timers1.md

This file was deleted.

25 changes: 0 additions & 25 deletions develop/codingguidelines/UserInterface/CODUserInterface.md

This file was deleted.

2 changes: 1 addition & 1 deletion develop/codingguidelines/UserInterface/Displayed_text.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ uid: Displayed_text

# Displayed text

- All displayed textual items, e.g. parameter descriptions, button values, discrete values, tooltips, element wizard text etc. that will be displayed in DataMiner must be user-friendly and adhere to the following rules.
All displayed textual items, e.g. parameter descriptions, button values, discrete values, tooltips, element wizard text, etc. that will be displayed in DataMiner must be user-friendly and adhere to the following rules:

- [Title case](xref:Title_case)

Expand Down
9 changes: 0 additions & 9 deletions develop/codingguidelines/UserInterface/Element_wizard.md

This file was deleted.

Loading