Does the single responsibility principal promote flexibility? If not what are the other methods to make your classes more flexible?By flexibility I mean, a class is able to function correctly at any time with little (or even with no) hassle.
Does the single responsibility principal promote flexibility?
methods;design principles
Yes. A class that does one thing can be reused in other contexts easily where that responsibilty is necessary; if a class has more than one responsibility, in most cases those other responsibilities create dependencies that might be hard to satisfy in a different context.Example: A class that does some calculation is easy to reuse. A class that does the calculation and stores the result to the database is hard to reuse in a context without a database, even if you only need the calculation part. Maybe the constructor requires a database connection object, maybe the calculation does the update implicitely.