Model that combines all the attributes (which will sometimes be useless) or several small models?
Yes it is not a good idea. Because each time you make an instance from your class it reserve that much memory even if you don't fill all the fields and in the long term your app performance will decrease.
I'm trying to build my first website, a little RP game to play in school. It is a hero who plays an adventure and must make the right decisions.
In my program I have a model for each component: hero, NPC, trap, obstacle, closure ... all of which have a generic relation with an Interaction class.
It would be simpler for me to have only a global interaction class which includes all the necessary attributes. In each instance it would suffice for me to specify what type of interaction it is and to fill in only the attributes concerned.
But then I will end up with instances containing most of the time many empty fields.
Is it a problem? Bad practice?
Thx !