I am writing a class which consists mostly of data storage responsibilities. The context for the use of this class will, in general, be retrieving an array of objects of this type for display later. In light of that, I've created a static method, build_question_array(), which queries the database, instantiates the objects, and returns the array.  Does this violate the SOLID principle?
Do Builder static methods violate SOLID?
design;object oriented;solid
Firstly, it does not obey the Open/Closed principle, because you won't be able to change anything at runtime in a static method.I don't know whether it obeys the Single Responsibility principle, because I don't know whether it implements or delegates all of its work. If it implements it, it doesn't obey this principle.EDIT: If that static method is inside the data structure's class, then it definitely does not obey SRP. The data class should not know or care about its various types of uses.The Liskov Substitution principle isn't a factor since it's only one class, and it's a static method.Interface Segregation also doesn't apply here.Dependency Inversion is questionable here, because unless you can pass a delegate to this function or you're using a dynamic language, you're making every one of your clients depend on this sole implementation of this functionality.So all in all, no, it doesn't.