iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
90.13k stars 26.63k forks source link

Binding Properties pattern #67

Open iluwatar opened 9 years ago

iluwatar commented 9 years ago

Description

The Binding Properties design pattern is used to synchronize state between different components or objects in a system, ensuring that changes in one part are automatically reflected in another. This pattern is particularly useful in scenarios involving UI components and their underlying data models, where maintaining consistent state across various elements is crucial.

Main Elements of Binding Properties Pattern:

  1. Observable Property: A property whose changes can be observed by other objects.
  2. Observer: An object that subscribes to changes in the observable property and updates itself accordingly.
  3. Binding Mechanism: The infrastructure that connects the observable properties with their observers, facilitating the automatic update process.
  4. Two-Way Binding: An optional feature where changes in either the observable property or the observer can propagate in both directions.

References

  1. Java Design Patterns Project Contribution Guidelines
  2. Binding Properties Design Pattern - Wikipedia
  3. Binding Properties in WikiWikiWeb

Acceptance Criteria

  1. Implementation of Observable Property: Create a class representing an observable property that allows observers to register and unregister, and notifies them of changes.
  2. Observer Interface: Define an interface for observers that requires an update method, which will be called when the observable property changes.
  3. Binding Mechanism: Develop the infrastructure to link observable properties with their observers, supporting at least one-way binding. Optionally, implement two-way binding functionality.

Please ensure that the implementation adheres to the project contribution guidelines and includes appropriate documentation and test cases.

Apeiria01 commented 3 years ago

Shall I work on this issue?

ohbus commented 3 years ago

Shall I work on this issue?

⭐ Sure thing! Thanks for your interest in our project 😃

✔️ Please mention a 📆 timeline 🕙 for when can we expect 🤔 a Pull Request against this issue.

Apeiria01 commented 3 years ago

Shall I work on this issue?

⭐ Sure thing! Thanks for your interest in our project 😃

✔️ Please mention a 📆 timeline 🕙 for when can we expect 🤔 a Pull Request against this issue.

It is ready.

iluwatar commented 6 months ago

Updated task description