Let's say I have a class modeling some kind of object, for example a graph (in the graph theory sense).
I will have the graph structure and data inside the class, but what about other more complex behaviors? For example, I want to create a function that transforms the graph in a specific way, or that dumps the graph in a JSON format. Should these functions be inside or outside the class?
My first thought is to put these kinds of functions inside the class, but if I put a lot of functions, each graph object will take way more memory right?
Are there clear guidelines for this question? Also, is it language dependant?