Robustness is defined by IEEE as "The degree to which a system or component can function correctly in the presence of invalid inputs or stressful environmental conditions".
What real-world scenarios can illustrate this problem? And what GoF design patterns are suitable for solving robustness?
Since the areas of robustness are error handling, fault tolerance, and recoveryability. But I don't have an idea how to use design patterns to solve it.
class Dao {
...
public void timeout() {
// some logic here
throw new RunTimeException("This session is timeout");
}
}
Many exceptions may be defined in the Dao class.
If I use design patterns to solve this problem, should I create a factory pattern to handle each exception and create a class for each exception?
GoF and design patterns are just a set of solutions that software engineer noticed keep reoccurring.
Many beginners unfortunately try and cram these design patterns into every problem they see, this is a very bad usage of them.
GoF does not guarantee robustness (or anything really). GoF is just a bunch of really common solutions that four engineers have noticed. Other design patterns (non GoF) too, are just common solutions (but not as widely recognized as GoF's)