Skip to content

Commit

Permalink
sync readme, nupkg contents
Browse files Browse the repository at this point in the history
  • Loading branch information
martinothamar committed Feb 21, 2024
1 parent 7dfc51f commit 59cb4b9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 25 deletions.
71 changes: 47 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/dnv-opensource/vista-sdk/build-csharp.yml?branch=main&label=C%23)](https://github.com/dnv-opensource/vista-sdk/actions)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/dnv-opensource/vista-sdk/build-js.yml?branch=main&label=JS)](https://github.com/dnv-opensource/vista-sdk/actions)
[![GitHub](https://img.shields.io/github/license/dnv-opensource/vista-sdk?style=flat-square)](https://github.com/dnv-opensource/vista-sdk/blob/main/LICENSE)<br/>
[![SDK NuGet current](https://img.shields.io/nuget/v/DNV.Vista.SDK?label=NuGet%20DNV.Vista.SDK)](https://www.nuget.org/packages/DNV.Vista.SDK)
[![SDK NuGet prerelease](https://img.shields.io/nuget/vpre/DNV.Vista.SDK?label=NuGet%20DNV.Vista.SDK)](https://www.nuget.org/packages/DNV.Vista.SDK)<br/>
[![SDK NPM current](https://img.shields.io/npm/v/dnv-vista-sdk?label=NPM%20dnv-vista-sdk)](https://www.npmjs.com/package/dnv-vista-sdk)
[![SDK NPM current](https://img.shields.io/npm/v/dnv-vista-sdk/preview?label=NPM%20dnv-vista-sdk)](https://www.npmjs.com/package/dnv-vista-sdk)<br/>

## Vista SDK
The Vista team at DNV are working on tooling related to
* DNV Vessel Information Structure (VIS)
Expand All @@ -10,9 +18,16 @@ users and implementers of the standards.
Our plan is to develop SDKs for some of the most common platforms. We are starting with .NET, Python and JavaScript.
We will be developing these SDKs as open source projects. Feel free to provide input, request changes or make contributions by creating issues in this repository.

For general documentation relating to VIS and relating standard. See [vista.dnv.com/docs](https://vista.dnv.com/docs).
For general documentation relating to VIS and relating standard. See [docs.vista.dnv.com](https://docs.vista.dnv.com).

### Status

> **_NOTE:_** These SDKs are currently being used in production at DNV, and will be open sourced and released under preview initially.
> [!NOTE]
> The **v0.1** versions of the SDK are currently in production use at DNV for various services.
> We are currently working on the **v0.2** version of the SDKs where we are adressing several usability and API design issues.
> When **v0.2** is finalized we are hoping that **v1.0** will quickly follow.
> New users should stick to **v0.1** currently while we work on stabilizing APIs and design.
> Functionally (in terms of domain), not much will change
### Content

Expand All @@ -24,15 +39,9 @@ Each SDK makes use of the contents of the resources and schemas folders to gener
┃ ┣ 📜codebooks-vis-3-4a.json.gz
┃ ┗ 📜gmod-vis-3-4a.json.gz
┣ 📂schemas
┃ ┣ 📂avro
┃ ┃ ┣ 📜DataChannelList.avsc
┃ ┃ ┗ 📜TimeSeriesData.avsc
┃ ┣ 📂json
┃ ┃ ┣ 📜DataChannelList.schema.json
┃ ┃ ┗ 📜TimeSeriesData.schema.json
┃ ┗ 📂xml
┃ ┃ ┣ 📜DataChannelList.xsd
┃ ┃ ┗ 📜TimeSeriesData.xsd
┣ 📂csharp
┣ 📂python
┣ 📂js
Expand All @@ -46,20 +55,26 @@ This section will outline the various components and modules in our SDKs.

#### Vessel Information Structure

There are two codified components of VIS in our SDKs
There are various components of VIS in our SDKs:

* Generic product model (Gmod)
* Codebooks
* Coming soon - versioning support, ability to convert gmod nodes and paths between versions of gmod
* Generic product model (Gmod) - C#, JS
* Product model (Pmod) - JS
* Codebooks (metadata tags) - C#, JS
* Locations - C#, JS

For more information on this concepts, check out [vista.dnv.com/docs](https://vista.dnv.com/docs).
For more information on this concepts, check out [docs.vista.dnv.com](https://docs.vista.dnv.com).

#### ISO-19848 and ISO-19847

Part of these standards are the definition of datastructures used for communicating and sharing sensor data.
Note that while compression isnt explicitly mentioned in these standards, the standard doesnt prohibit use
of compression when implementing these standards, as long as the datastructures remain the same.

Related components:

* Universal ID & Local ID - C#, JS
* DataChannelList & TimeSeriesData - C#, JS

### Benchmarks

We are developing some benchmarks to keep track of the performance characteristics of the libraries we are creating.
Expand Down Expand Up @@ -101,17 +116,25 @@ WarmupCount=3
| Avro | Bzip2 | 9 | 13,762.6 μs | 2,310.1 μs | 126.62 μs | 19.5 KB |


## Builder pattern
Typically, when the SDK provides code for building classes, it does so in a Builder Pattern. It provides possibility to chain using With, TryWith and Without methods.
```
builder = Create(someIntro)
.WithSomeValue(in someValue)
.TryWithSomeOtherValue(in someOtherValue)
.WithoutSomeThirdValue() // usually without/limited arguments
builder.TryWithValue(item, out var success)
if(!success)
throw
### API patterns

#### Immutability

Domain models exposed in the SDKs are generally immutable,
the builder APIs construct new instances while passing along the old data that is not modified by the builder method invoked.

#### Builder pattern

Typically, when the SDK provides code for building classes, it does so in a Builder Pattern. It provides possibility to chain using With, TryWith and Without methods.

```csharp
builder = Create(someIntro)
.WithSomeValue(someValue)
.TryWithSomeOtherValue(someOtherValue)
.WithoutSomeThirdValue() // usually without/limited arguments
builder = builder.TryWithValue(item, out var success)
```

* `With` should be used when the operation is expected to receive non-nullable values and succeed without further checking. It will throw error if provided with wrong arguments.
* `TryWith` should be used in two cases: When you don't want to be bothered by failures behind the scene, and when you want to know if it went ok, but without exceptions. If you want to check if the opration went as expected, you can use the try do out param - "succeeded" e.g. TryWithSomething(intput, out bool succeeded).
* `Without` provides functionality for removing certain elements from the chain. Typically without arguments/limited arguments
* `Without` provides functionality for removing certain elements from the chain. Typically without arguments/limited arguments
1 change: 0 additions & 1 deletion csharp/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<Author>DNV AS</Author>
<Company>DNV AS</Company>
<Copyright>DNV AS</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<Copyright>Copyright 2022 DNV AS</Copyright>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down
7 changes: 7 additions & 0 deletions csharp/src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<Project>
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\..\README.md" Pack="true" PackagePath="\" />
<None Include="..\..\..\LICENSE" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
Expand Down

0 comments on commit 59cb4b9

Please sign in to comment.