abstract class, all derived concrete classes should be singletons

تعرفه تبلیغات در سایت

آرشیو مطالب

امکانات وب

Vote count: 0

I'm looking for best practices for the following design: I have an abstract class and every concrete class extending that abstract class should be a singleton.

Background: The concrete classes are collectors that compile and log statistics about the operation of a complex legacy system. Collectors are accessible via a static registry, so there's no need to pass dependencies. The abstract class provides the interface to the registry.

I'm aware that there's no perfect solution that gives guarantees, properties have to be maintained by conventions. Nevertheless, there might be best practices for this case.

asked 25 secs ago
Ulrich Scholz

نویسنده : استخدام کار بازدید : 0 تاريخ : سه شنبه 29 اسفند 1396 ساعت: 14:30
برچسب‌ها :

خبرنامه

عضویت

نام کاربري :
رمز عبور :