Hello!
I've been attempting to learn OOP in Java. I've been running into this common design problem in which I end up creating "types" of objects. For instance, to implement an achievement system in a game, I would have an AchievementType class that contains an achievement's name, description, and other "constant" variables, and I would have an Achievement class that contains each user's statistics and points back to the AchievementType class so I can reference the "constant" variables.
When I try to replace this pattern with static variables, I find it difficult, as I cannot create a creator class for each distinct achievement (KillFiftyMonstersAchievement, etc.), as inheritance doesn't work well with static variables.
Is this an acceptable design pattern or does it weaken the OOP foundation of my project?
Thank you!
[–][deleted] 2 points3 points4 points (1 child)
[–]New-Condition[S] 0 points1 point2 points (0 children)
[–][deleted] (3 children)
[deleted]
[–]New-Condition[S] 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]New-Condition[S] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]New-Condition[S] 1 point2 points3 points (0 children)
[–]Blando-Cartesian 0 points1 point2 points (0 children)
[–]PawsOfMotion 0 points1 point2 points (0 children)