Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

"Writable" similar to "Observable" instead of just "Property" #12

@manuel-mauky

Description

@manuel-mauky

At the moment you have a Observable interface which defines methods for "read-only" access and the Property interface which extends Observable and adds the possibility to change the value. However, this means that if you have an instance of Property you can allways "read" the current value.

I suggest to add an interface Writable (or find a better name) that defines "write-only" methods. Then Property should extends both Observable and Writable. This way you can have an instance of Writable that the developer can only use to change the value but not to read the value.

This way you could be more specific and expressive when designing the API of your component. If your Component only provides an Observable to the outside world it's clear that this is only intended to get values from the Component. If you provide only an Writable it's clear that this is only intended to set values into the Component. If you provide a Property it's clear that both is intended.

This should also be considered when designing binding support. There should be something like a unidirectional binding but with inversed data flow. If you have an instance of an Observable you could bind this to a Writable so that when the value of the Observable changes it's pushed to the Writable.

The idea behind this comes from my JavaFX projects where I had situations where I wished for something like a WriteOnlyProperty instead of only Property and ReadOnlyProperty.

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