1/42
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Observer Pattern
Design pattern for notifying changes to observers.
Model-View-Controller (MVC)
Architectural pattern separating application logic from UI.
Pull Model
Each party retrieves information when interested.
Polling
Periodically requesting information from another component.
Coupling
Dependency between components; changes affect each other.
Push Model
Notifies interested parties when changes occur.
Subject Interface
Defines methods for registering and notifying observers.
Observer Interface
Defines method for updating observers with new data.
ConcreteSubject
Implements Subject; maintains observer list and state.
ConcreteObserver
Implements Observer; reacts to state changes.
Inversion of Control (IoC)
B calls A instead of A calling B.
Callback
Function passed as an argument to another function.
ArrayList
Dynamic array implementation in Java for storing elements.
Abstract Class
Class that cannot be instantiated; may contain abstract methods.
Constructor
Special method for initializing new class instances.
MVC Goals
Decouple UI from data and manage multiple views.
Strategy Pattern
Encapsulates algorithms for interchangeable use.
Model-View-Adapter (MVA)
Mediator pattern ensuring views interact only through controllers.
Event Subscription
Process where observers register to receive updates.
State Change Notification
Informing observers when the subject's state changes.
Redraw Method
Updates the visual representation of a window.
Observer Registration
Adding an observer to the subject's list.
Observer Removal
Removing an observer from the subject's list.
Notify Observers
Calls update method on all registered observers.
Set Value Method
Updates the subject's value and notifies observers.
Performance Problem
Issues arising from inefficient checking for changes.
Maintenance Problem
Challenges due to tight coupling of components.
Window Class
Represents a UI window that observes file changes.
FileSystem Object
Represents the underlying file system in the experiment.
User Input
Data entered by the user through the UI.
View Tier
Layer responsible for displaying data to users.
Logic Tier
Layer handling application logic and processing.
Storage Tier
Layer managing data storage and retrieval.
Observer Pattern Implementation
Model acts as Subject; views act as Observers.
Update Method
Method called to refresh observer state.
Observer Registration Method
Method for adding observers to the subject.
Observer Notification Method
Method for informing observers of state changes.
Concrete Observer Update
Updates the observer's state based on subject's value.
Observer Pattern Benefits
Decouples components, enhances flexibility and scalability.
Observer Pattern Drawbacks
Potential for memory leaks if observers are not removed.
Observer Pattern Use Cases
Used in event handling, data binding, and UI updates.
Observer Pattern Variants
Includes push and pull models for notifications.
Observer Pattern Examples
Common in GUI frameworks and real-time systems.