Commit 3eca5ba
committed
Refactored the code for building pipelines in Metamorph
In the original implementation of Metamorph `Data` and `Collect` objects
managed the plumbing of their function pipelines internally (via
`AbstractNamedValuePipeHead`). From the perspective of the
`MorphBuilder` `Data` and `Collect` objects were connected directly. The
fact that the connection was actually done through the function pipeline
was hidden. While this approach simplified the `MorphBuilder`, it
increased the complexity of the interfaces for connecting the different
types of objects in Metamorph. Additionally, functions were required to
handle the source parameter in the `receive` method differently compared
to the implementations of the method in `Data` or `Collect` objects.
Finally, it the half-hidden implementation of the function pipelines
makes it very hard to add interceptors (e.g. for logging or debugging)
to the pipe system generated from a Metamorph script.
This commit tries to solve the short-comings of the original
implementation with to changes. First, connections of `Function`, `Data`
and `Collect` objects are now handled in the same way and the function
pipelines are no longer hidden in the other two objects. Second, the
objects are no longer connected to a receiver (via
`setNamedValueReceiver`) but the connection is set the other way round
using `addNamedValueSource`. While this approach appears slightly less
intutive than the original method, it removes the necessity for
calling `addNamedValueSource` in addition to `setNamedValueReceiver`.
Furthermore it unifies setting of an object as name source or
condition source and setting an object as standard data source. This is
now all done from the perspective of the receiver. This simplifies the
implementation of the relevant methods in the collectors.1 parent 7931ba0 commit 3eca5ba
File tree
26 files changed
+197
-172
lines changed- src
- main/java/org/culturegraph/mf/morph
- collectors
- functions
- test/java/org/culturegraph/mf/morph
26 files changed
+197
-172
lines changedLines changed: 17 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 27 | | |
32 | 28 | | |
33 | | - | |
34 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
44 | 42 | | |
45 | 43 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
325 | 335 | | |
Lines changed: 87 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
50 | 85 | | |
51 | 86 | | |
52 | 87 | | |
53 | | - | |
| 88 | + | |
54 | 89 | | |
| 90 | + | |
55 | 91 | | |
56 | 92 | | |
57 | 93 | | |
| |||
135 | 171 | | |
136 | 172 | | |
137 | 173 | | |
138 | | - | |
139 | | - | |
| 174 | + | |
140 | 175 | | |
| 176 | + | |
| 177 | + | |
141 | 178 | | |
142 | 179 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 180 | + | |
152 | 181 | | |
153 | 182 | | |
154 | 183 | | |
155 | 184 | | |
156 | | - | |
157 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
158 | 194 | | |
159 | | - | |
160 | | - | |
161 | | - | |
| 195 | + | |
162 | 196 | | |
163 | | - | |
164 | 197 | | |
165 | 198 | | |
166 | 199 | | |
167 | 200 | | |
168 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
169 | 205 | | |
170 | 206 | | |
171 | 207 | | |
172 | 208 | | |
173 | | - | |
| 209 | + | |
174 | 210 | | |
175 | 211 | | |
176 | 212 | | |
177 | 213 | | |
178 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
179 | 218 | | |
180 | 219 | | |
181 | 220 | | |
182 | 221 | | |
183 | | - | |
| 222 | + | |
184 | 223 | | |
185 | 224 | | |
186 | 225 | | |
| |||
194 | 233 | | |
195 | 234 | | |
196 | 235 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
| 236 | + | |
208 | 237 | | |
209 | 238 | | |
210 | 239 | | |
211 | 240 | | |
212 | | - | |
213 | | - | |
214 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
215 | 251 | | |
216 | | - | |
217 | | - | |
218 | | - | |
| 252 | + | |
219 | 253 | | |
| 254 | + | |
220 | 255 | | |
221 | 256 | | |
222 | 257 | | |
223 | | - | |
224 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
225 | 263 | | |
226 | 264 | | |
227 | 265 | | |
| |||
265 | 303 | | |
266 | 304 | | |
267 | 305 | | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
273 | 310 | | |
274 | 311 | | |
275 | 312 | | |
Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
0 commit comments