Is it okay to store all Data in an Data Class?
Is it okay for a school project to store all Data like Variables, Objects and other stuff in one "Data Class"? Because I have heard once that you should never do something like this. Are there any other and better approaches to this topic? Thank you. (:
Is it okay for a school project to store all Data like Variables, Objects and other stuff in one "Data Class"? Depends upon what that data is, but almost certainly not, because of the Single Responsibility Principle: The single responsibility principle states that every module or class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility. Robert C. Martin expresses the principle as, "A class should have only one reason to change." Only the data relevant to a specific class should be stored in that class. If it's not relevant to one class, it may be relevant to another, and so should be placed in there. It also sounds a bit like you're describing a God object, which is considered an anti-pattern: a God object is an object that knows too much or does too much
I need to create an iso-8859-1 encoded URI (java.net.URI)
How to create a Jcache in Spring Java config?
Incompatible nullness constraints in java class hierarchy with generics
Can't run java from PHP's exec
I cant understand this Applet and Thread code in Java
Java- get user home on user machine not on server
Retrieving data from ArrayList
Universal Image Loader image scaling distortion
Handling on Jersey (JAX-RS) on XMLHttpRequest abort
Apache Spark and MongoDb Date issue
Why am I getting the exception - java.lang.NoClassDefFoundError: com.google.android.gms.R$string?
Media Player crash
Android Gradle Build Error With Parse SDK
How to convert ArrayList into JList object? java [duplicate]
Android application crashes every other compilation/launch
Java Error: Ubuntu - And OS X - Java -v command throws errors, .jar files not running properly