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
How to get the pid of a Java subprocess? [duplicate]
Error calling rest service using eclipse and jersey [duplicate]
How to get the first 2 records from Access's Table and Add them to Jtable (Data filter)
Setting required length of a string
how to view http post result in a browser using java
Not applicable argument? [duplicate]
Getting input from users command and using .equals
JavaFX - Embedded File Navigation
i made a class to create a HashMap and am not being able to implement it form another class in the same package in java
Entering and exiting application with JavaFX
Possible lossy conversion from double to int?
How to return an array from JNI to Java in Android?
Java Unsupported major.minor version 51.0 running jar file
Find the first time that value in a list surpass a value in another list
Get folder and subfolder id Google Drive
Mock Future object [duplicate]