rules
rules copied to clipboard
Naming inside Entity
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behaviour
The naming of Entity
members do not follow a common convention.
Expected behaviour
It should be easy to identify members coming form Entity
.
Minimal reproduction of the problem with instructions
interface Entity {
identity(): string;
className(): string;
getTypes(): any;
}
What is the motivation / use case for changing the behaviour?
Having an easy-to-follow naming structure.
interface Entity {
entityIdentifier(): string; // before: identity
entityName(): string; // before: className
entityTypes(): any; // before: getTypes
}
What is this common convention
are you refering to ?
In this case it would be the prefix entity
.
It clearly expresses that the methods come from the interface.
Another example would be Angular itself: ngOnInit
, ngOnDestroy
,...
I think the benefit is that as the entity grows, a visual boundary between implemented and own members exist.
But I also have to confess that this proposal is based on my personal preference.
make sense.
It will be braking change as most of the apps, demos, tests needs to be updated.
A possible way without breaking anyone would be introducing an interface in parallel.
interface MetaEntity {
metaIdentifier(): string; // before: identity
metaName(): string; // before: className
metaTypes(): any; // before: getTypes
}
I consider this issue to be very low prio. For sure, there are more important todos.
Or we can simplly write not into braking changes, later for such things we can use schematics. Let;s do it.