mardi 26 janvier 2021

How to filter the information of the data structure?

This is my first question.

I need some idea of what is the best application or design to apply to my small problem.

I have a data structure (see Figure 1) that I implemented as a Node. Each Node has an associate type (TypeNode) and some relationships (child attribute).

1. Data structure with Node

In some point of my program, I need to filter the information of the data structure. For example, keep only the Nodes of Type Material and Color. Thus, I need to receive a list of Node of type Material and Color.

The questions are:

  • Any Design Pattern that can solve this problem?. I was thinking the Criteria Design Pattern, but I am not sure if it will be the best solution.

  • Any other possible approach or application that can help?. For example, any (NoSQL) datasabe that stores the information of my data structure and then we can perform some "query" to keep only the Nodes of Type Material and Color.

I am open to any idea!

Thank you in advance.

CG

Aucun commentaire:

Enregistrer un commentaire