Say I have currently the following model structure,
class Entity {
id : string;
}
class HateoasEntity extends Entity{
_links : any;
_msgs : any;
}
class EditableEntity extends HateoasEntity{
_new : boolean;
_editInProgress : boolean
}
class Employee extends EditableEntity{
name : string;
address : string;
}
For this, Can I create custom typescript decorators to add those metadata without inheritance?
@Entity
@HateoasEntity
@EditableEntity
class Employee{
name : string;
address: string;
}
Is it a good way to go with decorators? Or what i am trying to achieve is bad design?