Refactor notification service abstraction
- Removed observer map from Subject base class - Removed notify() from Subject interface - Made NotificationManagementService abstract with pure virtual methods - Added static observer maps to notification service implementations - Added attach() and detach() overrides in inventory, payment, and service management services - Added update() override in User model for observer pattern support - Updated notification method declarations with override specifiers
This commit is contained in:
@@ -7,11 +7,8 @@ class Notification;
|
||||
|
||||
class Subject
|
||||
{
|
||||
protected:
|
||||
util::Map<std::string, User*> m_observers;
|
||||
public:
|
||||
virtual ~Subject() = default;
|
||||
virtual void attach(User* user) = 0;
|
||||
virtual void detach(User* user) = 0;
|
||||
virtual void notify(Notification* notification) = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user