Skip to content

Mixins #3

@fluxtah

Description

@fluxtah

Currently the grammar supports the concept of extending responses with an entity.

response extends Base { ... }

This has recently been changed to

response mixin Base { ... }

At the moment Base should be defined as an entity, however it would be better to introduce a specific keyword to specify something that can be "mixed in"

Some languages have the concept of categories, it could work like this:

properties Base {
    status:boolean,
    message:string
}

Which is basically a bag of properties that can be 'mixed in' with other entities.

SInce some responses can be defined anonymously (which might be a bad thing anyway), ie:-

resonse {
    status:boolean,
    message:string
}

Then it makes sense to allow a mixin here (which mechanoidnet supports as extends, ie:-

response mixin Base {
   qux:string
}

and as mentoined with entities:-

entity Repository mixin Base {
   id:int,
   name:string
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions