iluwatar / java-design-patterns

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

BLoC design pattern #2374

Open iluwatar opened 1 year ago

iluwatar commented 1 year ago

Description

The BloC (Business Logic Component) design pattern helps separate business logic from UI components, making applications more modular, testable, and maintainable. This pattern is widely used in Flutter development and involves three main components: Event, State, and Bloc. Events are dispatched by the UI, which are processed by the Bloc to produce new States that the UI listens to and reacts accordingly.

The key elements of the BloC pattern are:

  1. Event: Represents the actions taken by the user or system.
  2. State: Represents the state of the UI at any point in time.
  3. Bloc: Handles the business logic, receives events, processes them, and emits new states.

References

Acceptance Criteria

  1. Implement a basic BloC pattern structure including Event, State, and Bloc classes.
  2. Provide a simple example demonstrating the pattern in action.
  3. Ensure the implementation follows the project contribution guidelines outlined here.
girolamo-giordano commented 1 year ago

Hi @iluwatar can you assign the issue to me?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.