Skip to content

Commit 537e499

Browse files
committed
fix typos, add json property names
- fix JsonPropertyName for relationships in dom - fix equals type on Cardinality - clean code documentation snippets - add missing [JsonPropertyName] for some attributes -
1 parent 05c5f9e commit 537e499

File tree

4 files changed

+31
-20
lines changed

4 files changed

+31
-20
lines changed

DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/Cardinality.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@ public class Cardinality
1717
/// <summary>
1818
/// Optional information to name a certain cardinality construct.
1919
/// For example one-to-one, one-to-many, or many-to-many.
20-
/// E.g. one-to-one could be defined as {"from": {"min": 1, "max": 1}, "to": {"min": 1, "max": 1}}.
20+
/// E.g. one-to-one could be defined as {"fromRange": {"min": "1", "max": "1"}, "toRange": {"min": "1", "max": "1"}}.
2121
/// </summary>
2222
[JsonPropertyName("name")]
2323
public string? Name { get; set; }
2424

2525
/// <summary>
2626
/// The 'from' component in the cardinality, e.g. the '1' in 1 to many.
2727
/// </summary>
28+
[JsonPropertyName("fromRange")]
2829
public CardinalityRange? FromRange { get; set; } = new CardinalityRange { Min = "1", Max = "1" };
2930

3031
/// <summary>
3132
/// The 'to' component in the cardinality, e.g. the 'many' in 1 to many.
3233
/// </summary>
34+
[JsonPropertyName("toRange")]
3335
public CardinalityRange? ToRange { get; set; } = new CardinalityRange { Min = "1", Max = "N" };
3436

3537
/// <summary>
@@ -55,13 +57,13 @@ public class Cardinality
5557

5658
#region Methods
5759
/// <summary>
58-
/// Use this method to assert if two Data Connections are the same, based on their Ids.
60+
/// Use this method to assert if two Cardinalities are the same, based on their Ids.
5961
/// </summary>
6062
/// <param name="obj"></param>
61-
/// <returns>True if the Data Connections are the same, based on their Ids</returns>
63+
/// <returns>True if the Cardinalities are the same, based on their Ids</returns>
6264
public override bool Equals(object? obj)
6365
{
64-
var other = obj as DataConnection;
66+
var other = obj as Cardinality;
6567
return other?.Id == Id;
6668
}
6769

@@ -72,8 +74,8 @@ public override bool Equals(object? obj)
7274
public override int GetHashCode() => (Id?.GetHashCode()) ?? 0;
7375

7476
/// <summary>
75-
/// String override so that the object returns its value ('connection string').
76-
/// When an instance of this class is passed to a method that expects a string, the ToString() method will be called implicitly to convert the object to a string, and the value of the "Connection String" property will be returned.
77+
/// String override so that the object returns its value ('Name').
78+
/// When an instance of this class is passed to a method that expects a string, the ToString() method will be called implicitly to convert the object to a string, and the value of the "Name" property will be returned.
7779
/// </summary>
7880
/// <returns>The Name</returns>
7981
public override string ToString()

DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/CardinalityRange.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
/// <summary>
44
/// The possible range for a from/to component for the cardinality.
5-
/// For eaxmple "min": 1, "max": "N"
6-
/// This way, you can define at least 1 to many. Or 0 or 1 to 1.
5+
/// For example "min": "1", "max": "N"
6+
/// This way, you can define "at least 1 to many". Or "0 or 1 to 1".
77
/// </summary>
88
public class CardinalityRange
99
{
10+
[JsonPropertyName("min")]
1011
public string? Min { get; set; }
12+
13+
[JsonPropertyName("max")]
1114
public string? Max { get; set; }
1215
}

DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/DataObjectMapping.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
namespace DataWarehouseAutomation.DwaModel;
44

55
/// <summary>
6-
/// The mapping between a source and target data set / table / file.
7-
///
6+
/// <para>The mapping between a source and target data set / table / file.</para>
7+
/// <para>
88
/// The DataObjectMapping is the element that defines an individual source-to-target mapping / ETL process. It is a mapping between a source and target object - referred to as DataObjects.
9-
/// The DataObject is in fact a reusable definition in the Json schema.
10-
///
11-
/// This definition is used twice in the DataObjectMapping: as the *SourceDataObject* and as the *TargetDataObject* - both instances of the DataObject class / type.
12-
///
13-
/// The other key component of a DataObjectMapping is the* DataItemMapping*, which describes the column-to-column(or transformation-to-column).
9+
/// The DataObject <see cref="IDataObject"/> is in fact a reusable definition in the Json schema.
10+
/// </para>
11+
/// <para>This definition is used twice in the DataObjectMapping: as the *SourceDataObjects* and as the *TargetDataObject*
12+
/// - both instances/lists of <see cref="IDataObject"/>,
13+
/// implemented as <see cref="DataObject"/> or <see cref="DataObjectQuery"/>.</para>
14+
/// <para>
15+
/// The other key component of a DataObjectMapping is the <see cref="DataItemMapping"/> *DataItemMapping*, which describes the column-to-column (or transformation-to-column).
1416
/// The SourceDataObject, TargetDataObject and DataItemMapping are the mandatory components of a DataObjectMapping.There are many other attributes that can be set, and there are mandatory items within the DataObjects and DataItems.These are all described in the Json schema.
17+
/// </para>
1518
/// </summary>
1619
public class DataObjectMapping : IMetadata
1720
{
@@ -54,7 +57,7 @@ public class DataObjectMapping : IMetadata
5457
/// The collection of associated data object for purposes other than source-target relationship.
5558
/// For example for lookups, merge joins, lineage etc.
5659
/// </summary>
57-
[JsonPropertyName("relatedDataObjects")]
60+
[JsonPropertyName("relationships")]
5861
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
5962
public List<Relationships>? Relationships { get; set; }
6063

DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/DataObjectMappingList.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
namespace DataWarehouseAutomation.DwaModel;
22

33
/// <summary>
4+
/// <para>
45
/// The schema's top-level object is a 'DataObjectMappingList'. It is an array of individual source-to-target mappings called 'DataObjectMappings', commonly referred to as 'mappings'.
5-
/// In code, this means a DataObjectMappingList is defined as a List/<DataObjectMapping/>.
6-
///
6+
/// In code, this means a DataObjectMappingList is defined as a List of <see cref="DataObjectMapping"/>.
7+
/// </para>
8+
/// <para>
79
/// A DataObjectMapping is a unique ETL mapping / transformation that moves, or interprets, data from a given source to a given destination.
8-
/// The decision to start the format with an array / list that contains potentially multiple DataObjectMappings relates to the Data Warehouse virtualization use-case. In these implementations, multiple individual mappings together create a single view object.
9-
/// As an example, consider the loading of a Core Business Concept / Hub type entity from various different sources.If you would use these different mappings to generate ETL processes you would create one physical ETL object for each mapping. However, if you are seeking to generate a view that represents the target table the result you would use the collection (list) of mappings to generate separate statements that are unioned in the single view object.
10+
/// The decision to start the format with an array / list that contains potentially multiple DataObjectMappings relates to the Data Warehouse virtualization use-case. In these implementations, multiple individual mappings together create a single view object.
11+
/// As an example, consider the loading of a Core Business Concept / Hub type entity from various different sources. If you would use these different mappings to generate ETL processes you would create one physical ETL object for each mapping. However, if you are seeking to generate a view that represents the target table the result you would use the collection (list) of mappings to generate separate statements that are unioned in the single view object.
12+
/// </para>
1013
/// </summary>
1114
public class DataObjectMappingList
1215
{

0 commit comments

Comments
 (0)