Skip to main content
added 217 characters in body
Source Link
JacquesB
  • 62.4k
  • 21
  • 137
  • 190

The SOLID principles are principles for designing object-oriented software. Your code example is not object oriented - it consists of stand-alone functions and some top-level code which is not even in a function. To interpret the code according to SOLID we need to know which class performs these operations for what purpose, and what the underlying responsibilities are. Depending on these factors, either example could be best.

Note specifically that the Single Responsibility Principle is not concerned about the responsibilities of individual methods, but apply on the class or module level. So it is not applicable on these code examples.

The SOLID principles are principles for designing object-oriented software. Your code example is not object oriented - it consists of stand-alone functions and some top-level code which is not even in a function. To interpret the code according to SOLID we need to know which class performs these operations for what purpose, and what the underlying responsibilities are. Depending on these factors, either example could be best.

The SOLID principles are principles for designing object-oriented software. Your code example is not object oriented - it consists of stand-alone functions and some top-level code which is not even in a function. To interpret the code according to SOLID we need to know which class performs these operations for what purpose, and what the underlying responsibilities are. Depending on these factors, either example could be best.

Note specifically that the Single Responsibility Principle is not concerned about the responsibilities of individual methods, but apply on the class or module level. So it is not applicable on these code examples.

Source Link
JacquesB
  • 62.4k
  • 21
  • 137
  • 190

The SOLID principles are principles for designing object-oriented software. Your code example is not object oriented - it consists of stand-alone functions and some top-level code which is not even in a function. To interpret the code according to SOLID we need to know which class performs these operations for what purpose, and what the underlying responsibilities are. Depending on these factors, either example could be best.