dev-guide:add-object-as-node-production
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dev-guide:add-object-as-node-production [2025/01/08 14:46] – gaetan | dev-guide:add-object-as-node-production [2025/01/08 16:33] (current) – [ProducingNode interface] gaetan | ||
---|---|---|---|
Line 17: | Line 17: | ||
==== toNode method ==== | ==== toNode method ==== | ||
- | The RGGProducer is testing if a java object that do not extend Node have a '' | + | The RGGProducer is testing if a java object that do not extend Node have a |
+ | <code java> | ||
+ | public Node toNode() { // return a Node } | ||
+ | </ | ||
+ | method. | ||
If it is the case it uses that method to create the Node to be added in the graph. The Node can have edges toward other Nodes (in the graph or not). Additional nodes will be set persistent. | If it is the case it uses that method to create the Node to be added in the graph. The Node can have edges toward other Nodes (in the graph or not). Additional nodes will be set persistent. | ||
Line 24: | Line 28: | ||
The toNode() method works well but requires a class. When working on bigger projects you might want to create interfaces that includes the knowledge that all implementation classes should have a " | The toNode() method works well but requires a class. When working on bigger projects you might want to create interfaces that includes the knowledge that all implementation classes should have a " | ||
- | Then, instead of using " | + | Then, instead of using " |
+ | <code java> | ||
+ | public Node produceNode() { //return a Node } | ||
+ | </ | ||
dev-guide/add-object-as-node-production.1736344011.txt.gz · Last modified: 2025/01/08 14:46 by gaetan