Static utility classes
If some logic is not related to any object instance, consider static utility class usage (avoid too many unnecessary singletons usage). Use static class (.NET) or final class with private constructor (Java). In Java do not declare constants in interfaces, use static utility classes instead: Use enums Do not create set of “flag”-like constants in types, use enum instead. Exception Handling Use exceptions only for the exceptional conditions Do not use exception for ordinary control flow.
|