如何避免使用枚举? [英] How to avoid using Enums?

查看:163
本文介绍了如何避免使用枚举?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到在这里询问问题从来没有考虑过(枚举)是一个坏事。对于那些认为他们不是最佳实践的人,有什么方法/模式可以避免在代码中使用?

Until asking a question on here I never considered (enums) to be a "bad thing." For those out there that consider them not to be best practice, what are some approachs/patterns for avoiding their use in code?

编辑:

public Enum SomeStatus
 Approved = 1
 Denied = 2
 Pending =3
end Enum


推荐答案

我喜欢 turtles 类枚举

这篇关于如何避免使用枚举?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆