Skip to content

Interfaces for components and implementations #36

@LourensVeen

Description

@LourensVeen

We could have interfaces for components and implementations, which would consist of a name, a declaration of a set of ports, and a description of the semantics any implementation would be expected to have.

Components could then specify such an interface, as could programs, and we could check compatibility. That would make custom_implementations safer, and allow the creation of tools that help a user of a model created by someone else to customise it in a sensible way.

There are use cases where we have different programs implementing the same physics, but some of them produce more outputs than others because e.g. they include more physical effects. To model that nicely, interfaces need to be able to extend (Java terminology) each other.

These interfaces would ideally be made together by a community, and be recorded in a set of ymmsl files. Authors of models and programs would then import and use them, so we'd need a from ... import interface ... to facilitate that.

Note that components already kind of are interfaces, which get an implementation, and we check that the ports are compatible. But that's duck typing, and it's possible to have two components with the same ports that are expected to do something different. So named types may be a good idea.

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