Skip to content

Reading measurement result from an instrument : property vs method #9

Description

@MatthieuDartiailh

The question is the following :
To retrieve the value of a physical quantity measured by an instrument which changes spontaneously (let's say the voltage of a multimeter), should we define :

  • a property (Feature)
  • a method (Action)

This is actually related to the problem of caching the Feature value. As if we use a Feature, we must either not cache the value or even if a cache exists query the value.
I am in favor of always returning the cache value if one exists, so we should either tell the Feature not to use the cache (@hgrecco is against this option as he thinks it will be confusing if not all Feature behave the same way with respect to caching), or always use a method and in such a case we may need some automation in writing standard methods.
@hgrecco would prefer to use the cache to avoid useless set and always perform get. This means that checking the instrument state will be an expensive operation even if it is known which is why I am not in favor of this solution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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