I'm building my own Canvas-style JPanel subclass which will draw a graph of nodes and arcs. As part of this application I am delegating the drawing of the nodes to a sprite class Node, i.e
Class Visualiser extends JPanel {
...
paintComponent(Graphics g) {
...
node.draw(g);
...
}
}
But I also have a class Node for a data structure. I'm not concerned about the nomenclature, I can call one NodeSprite to avoid conflicts, etc...
What I am wondering is whether to merge the data structure and the sprite class into one, as logically they both describe the same real-world thing, or if doing this would have any negative side effects such as performance, or general bad design.
Any suggestions?