paint-brush
How can you create flexible enums with different behaviors and associated values?by@e.rajasekar
8,002 reads
8,002 reads

How can you create flexible enums with different behaviors and associated values?

by Rajasekar Elango3mApril 27th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Enums are great to group objects with similar behavior. They are also efficient because only one instance of them will get created. However, it’s hard to implement enums for classes that has slightly different behaviors. Let me illustrate with an example.

Company Mentioned

Mention Thumbnail
featured image - How can you create flexible enums with different behaviors and associated values?
Rajasekar Elango HackerNoon profile picture
Rajasekar Elango

Rajasekar Elango

@e.rajasekar

L O A D I N G
. . . comments & more!

About Author

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite