You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/compas-sct.md
+60-9Lines changed: 60 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,6 @@ The below package diagram shows different part of the tool architecture.
17
17
Hence, we can distinguish four major parts:
18
18
19
19
***[sct-commons](#SCT-COMMONS)** : a library that contents shared functionalities for the bound SCL object.
20
-
***[sct-service](#SCT-SERVICE)** : It computes all needed operations and uses sct-data for database access.
21
20
***[sct-data](#SCT-DATA)** : It holds data models and database connectivity services.
22
21
***[sct-app](#SCT-APPLICATION)** : *TODO*.
23
22
@@ -82,23 +81,75 @@ should always return `true`:
82
81
[...]
83
82
}
84
83
85
-
86
-
87
84
## SCT DATA
88
85
Data models and connectivity to database are defined here. Data access layer is an abstract layer that defined connectivity
89
86
interfaces. This layer manages a database with single table (SQL-Like database) or single collection (NoSQL-Like database).
90
-
The concrete data access layers are implemented in specific packages
87
+
The concrete data access layers are implemented in specific packages. A data model can implement the following interface
88
+
89
+
```
90
+
public interface IScd <ID> {
91
+
ID getId();
92
+
byte[] getRawXml();
93
+
ID getHeaderId();
94
+
String getHeaderRevision();
95
+
String getHeaderVersion();
96
+
String filename();
97
+
}
98
+
```
91
99
92
100
*### SQL-Like Database
93
101
An implementation of the sct-data connectivity interface with custom data models. This allows the application to work with sql-like database.
94
102
The libraries ares use for SQL-Like databases, those that support XML type (PostgreSql, Oracle, etc)
95
103
96
104
*### NoSQL-Like Database
97
105
Like SQL-like part, this package contains the sct-data connector interfaces implementation for NoSQL-Like databases (BaseX, existDB, etc )
98
-
that support XML processing
106
+
that support XML processing.
107
+
108
+
This can also be a local repository connector (file system). For example, with meta-data headerID, headerVersion, headerRevision and filename
109
+
one can implement the connector to have the below output (with the constraint of having a single file in /pathTo/headerId/headerVersion/headerRevision):
110
+
111
+
```
112
+
myRepo
113
+
├───<headerID>
114
+
│ ├───<headerVersion1>
115
+
│ │ └───<headerRevision1>
116
+
│ │ | ├───<fileName1.scd>
117
+
│ │ └───<headerRevision2>
118
+
│ │ ├───<fileName2.scd>
119
+
```
99
120
100
-
## SCT SERVICE
101
-
This module implements all needed specification as functions (methods in Java). As shown in package diagram,
102
-
it interacts with sct-data (database access) and sct-commons (delegate SCL manipulation).
103
121
## SCT APPLICATION
104
-
**TODO**
122
+
**TODO**
123
+
124
+
### Tips for memory consumption's optimization
125
+
For large SCL file, it will not be a good idea to load the whole file in memory. JAXB is capable of processing XML file by chunks.
126
+
The need to load the whole SCL file relies on the fact that XML validation processes needs the entire file content.
127
+
To go through that processes we must take advantage on the XSD and build minimal SCL file from the large one.
128
+
The most "important" tags in the SCL file : Header, Substation, Communication, IED and DataTypeTemplate. By looking closely in the XSD file, one can realize
129
+
the below dependencies' logic :
130
+
* IED depends on DataTypeTemplate
131
+
* Communication depends on IED (IED name, Access Point)
132
+
133
+
Hence, with this in mind, one can reconstruct a minimal SCL file by focusing on the chunk of interest then realize creation/update operations
134
+
on the file and validate it against the XSD file.
135
+
136
+
For example: Updating IED
137
+
138
+
From SCD header's information, create a minimal SCD file
0 commit comments