Imagine I am using a class to bring back items from a database, say
class BankRecord {
public int id;
public int balance;
public void GetOverdraft() {
...
}
public void MakeBankrupt(){
...
}
}
Now, what would happen to the performance of using this if there were just 2 methods (as above) or 100 methods, maybe some of them very large.
Would instancing hundreds of these objects be worse if all the methods were on each object? This is for c#/java type languages, but it would be good to know for all languages.
Or is it good practice to have a seperate class, to perform all the actions on these objects, and leave the object as a pure data class?