Skip to content

Memento: caretaker shouldn't have access to state but it does #48

Open
@EDSprog

Description

@EDSprog

In the memento conceptual example, you have the next interface of Memento that will be used by caretakers:

interface Memento  {
    getState(): string;
    getName(): string;
    getDate(): string;
}

Following the pattern - caretakers shouldn't have access to the state that memento stores. But with the above interface, we can call memnto.getState() in any caretaker and receive the state because caretakers operate with memntos with this interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions