Add implementation for standalone converter, CLI and abstract converter interfaces#32
Add implementation for standalone converter, CLI and abstract converter interfaces#3201Parzival10 merged 22 commits intomainfrom
Conversation
1afc853 to
8eb45d8
Compare
|
@uuqjz Please review, I would like to have some feedback from you. Documentation is also starting to get added. See the |
239d16a to
54f88a3
Compare
uuqjz
left a comment
There was a problem hiding this comment.
Overall it looks good but slighlty overengineered.
I am wondering why we add an extra layer to each model to store the saving and read logic instead of putting it directly into the model. Maybe you can explain the benefits.
Further i suggest that someone else (Nicolas and or Tom) should review to.
...s/org.dataflowanalysis.converter/src/org/dataflowanalysis/converter/web2dfd/model/Child.java
Outdated
Show resolved
Hide resolved
tests/org.dataflowanalysis.converter.tests/META-INF/MANIFEST.MF
Outdated
Show resolved
Hide resolved
...taflowanalysis.converter.tests/src/org/dataflowanalysis/converter/tests/MicroSecEndTest.java
Show resolved
Hide resolved
|
The idea behind the abstraction of the input and output models for the converts is threefold: 1. Single Responsibility (Principle)The converter should only be responsible for converting a loaded model to another loaded model. 2. Better MaintainabilityThe older methods for handling different methods for loading the same model had lots of duplicate code. (e.g. the actual conversion). Some parts (like the high level calls to do the conversion) were not always extracted into a single method, instead spreading the code to all constructors 3. Enabling a common CLI interfaceAs the CLI works best when the converters have a common interface for the conversion, a common constructor would have been needed either way. Therefore, an interface like this would have been needed anyway, as the models require different elements, like Strings containing paths or the models themselves. Additionally, some converters need only one file, while some others require multiple. |
65b68d2 to
70e493b
Compare
|
@uuqjz @sebinside @Nicolas-Boltz Ready for review. Conflicts resolved/rebased |
sebinside
left a comment
There was a problem hiding this comment.
Here are couple of quick comments, besides the required rebase.
Additionally, I ran the standalone converter in interactive mode to convert JSON to DFD (which worked perfectly) and DFD to JSON which produced the following exception. Maybe I misused it, in that case, more hints / enhanced exception handling would be welcome ;)
Exception in thread "main" java.lang.RuntimeException: Cannot create a resource for 'file:/C:/[...]/OnlineShopDFDsimple/onlineshop.dataflowdiagram'; a registered resource factory is needed
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:403)
at org.dataflowanalysis.analysis.resource.ResourceProvider.loadModelContent(ResourceProvider.java:122)
at org.dataflowanalysis.analysis.dfd.resource.DFDURIResourceProvider.loadRequiredResources(DFDURIResourceProvider.java:36)
at org.dataflowanalysis.converter.dfd2web.DataFlowDiagramAndDictionary.<init>(DataFlowDiagramAndDictionary.java:112)
at org.dataflowanalysis.converter.interactive.ConvertTask.getConverterModelInteractive(ConvertTask.java:144)
at org.dataflowanalysis.converter.interactive.ConvertTask.runConversion(ConvertTask.java:122)
at org.dataflowanalysis.converter.interactive.ConvertTask.handleInteractive(ConvertTask.java:84)
at org.dataflowanalysis.converter.interactive.ConvertTask.main(ConvertTask.java:42)
...g.dataflowanalysis.converter/src/org/dataflowanalysis/converter/interactive/ConvertTask.java
Outdated
Show resolved
Hide resolved
...g.dataflowanalysis.converter/src/org/dataflowanalysis/converter/interactive/ConvertTask.java
Outdated
Show resolved
Hide resolved
...g.dataflowanalysis.converter/src/org/dataflowanalysis/converter/interactive/ConvertTask.java
Show resolved
Hide resolved
This issue should be fixed by 0a69912 |
|
@sebinside Issues should be resolved now |
5b8f95f to
4474df8
Compare
|
When I run it in normal mode and select PCM the options for output model are: When I run it in debug mode the options are While not too big of an issue this could cause a lot of confusion when you try to debug and quickly enter the numbers. |
…the conversion table
4a0f7af to
6abaad0
Compare
Test implemented in 6abaad0. It does not seem to be an issue anymore |
…re contained in the model
6abaad0 to
7242708
Compare
|
@sebinside @01Parzival10 This PR is ready for a re-review and can be merged |


This PR adds standalone functionality for the converter, a CLI and abstract converter interfaces:
This PR closes DataFlowAnalysis/DataFlowAnalysis#222