java - Solution to enum type with too many fields? [Improvement] -
as project gradually expanded, exited enum type need expand fields. example, there 1 enum class named ecityarea, used store city related informs, @ beginning city name necessary, need state informs, alias, image location , db alias etc. enum fields come little large, following codes :
ecityarea(string name, string state, string alias, string imagelocation, string imagefolder, string imagealias, string dbalias)
all developers can find there many fields, later there may more fields. predictably, ecityarea large , difficult read, there should solutions dilemma.
just now, got 1 idea , share you.
itegrate of fields enum class. following:
ecityareaimagerelated(string imagelocation, string imagefolder, string imagealias) ecityarea(string name, string state, ecityareaimagerelated imagerelated, string dbalias)
any other solutions provided? thanks.
Comments
Post a Comment