iluwatar / java-design-patterns

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

Elm architectural pattern #302

Open iluwatar opened 9 years ago

iluwatar commented 9 years ago

Description: The Elm design pattern, originating from the Elm language, is a pattern for building web applications that emphasizes simplicity, maintainability, and robustness. It follows the Model-View-Update (MVU) architecture, making state management predictable by using a single, immutable state.

Main Elements of the Pattern:

  1. Model: Represents the state of the application.
  2. View: A function of the model that returns the HTML representation.
  3. Update: A function that takes the current state and a message, returning a new state.
  4. Messages: Dispatched events that trigger state transitions.
  5. Commands: Side effects such as HTTP requests that do not change the state directly but might produce messages.

References:

  1. The Elm Architecture
  2. Elm Architecture Tutorial

Acceptance Criteria:

  1. Implement the Model-View-Update architecture with clear separation of concerns.
  2. Ensure immutability of the state and the predictability of state transitions.
  3. Provide comprehensive unit tests covering all components (Model, View, Update, Messages, and Commands).
iluwatar commented 5 months ago

Updated task description