0

Dear Stackoverflow community,

I'm developing a spring boot application which is using 3rd party library (https://github.com/goldmansachs/jdmn)

There is an object called TDefinitions which holds information about .dmn diagram. Somehow I need to persist this object or all the information that this object contains in my database, using Spring Data JPA repository. So that I can reuse it whenever I run my application again.

Could you please assist me what would be the ways to achieve that? Store it as a Blob or maybe serialize it somehow as a Json? The problem is it's not a simple object. Here's part of it's definition:

    @JsonPropertyOrder({...})
public class TDefinitions extends TNamedElement implements Visitable {
    @JsonProperty("import")
    private List<TImport> _import;
    private List<TItemDefinition> itemDefinition;
    private List<TDRGElement> drgElement;
    private List<TArtifact> artifact;
    private List<TElementCollection> elementCollection;
    private List<TBusinessContextElement> businessContextElement;
    private DMNDI dmndi;
    private String expressionLanguage;
    private String typeLanguage;

[...] 

How should I approach this problem from architectural perspective? How should I design my app? Provide interfaces/classes that extend elements from this library?

Wojtek Smol
  • 57
  • 1
  • 2
  • Create blob/clob field, and put it there. Question is why do you need it? That is something to be used to generate code... so I would keep it with source code, and generate java-code when needed. – Michał Zaborowski Sep 08 '22 at 15:18
  • Can't you create the .dmn out of that object and store that? Might be better than serializing the object that deals with it as I'd assume .dmn already is a format meant for storage and exchange. – Thomas Sep 08 '22 at 15:18
  • @Michał Zaborowski I'm no sure what you mean – Wojtek Smol Sep 08 '22 at 18:27
  • You can write anything to blob. Clob is large object, but text. If you can serialize it - it can be stored. According to their docs - this is just a notation - from that you create java code, and that is something you can use... If so - I would store that dmns with code - as documents / for future changes. – Michał Zaborowski Sep 08 '22 at 18:37
  • But then everyytime I want to evaluate decision from the DMN model I need to create this model from .dmn file and it takes time – Wojtek Smol Sep 08 '22 at 19:12

1 Answers1

0

I'd prefer NoSQL such as MongoDB for storing these types of objects. If you have to use SQL for some reason, then go with JSON.

D Chow
  • 1
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 13 '22 at 10:33