Ideally, you should never hard code any options or lists, everything should be used as an object of configuration being passed to a component. A few examples:
There are many instances of this across your application, the benefit of configurable structures is the ease of maintenance and modification. Always imagine that this behavior is used across the application, and one day you needed to make a small modification to every one of these instances, this will take hours if not days when it should've taken seconds.
Ideally, you should never hard code any options or lists, everything should be used as an object of configuration being passed to a component. A few examples:
Should be:
Another example, instead of:
You can do:
There are many instances of this across your application, the benefit of configurable structures is the ease of maintenance and modification. Always imagine that this behavior is used across the application, and one day you needed to make a small modification to every one of these instances, this will take hours if not days when it should've taken seconds.