I believe it's a question of responsibility. As I said, we use lookup tables primarily for presentation/reporting reasons. You could see that as translation as you pointed out.
Code generation cannot really be justified with just a single code structure (enums), as it has no logic or state whatsoever. Enums are constants and cannot really be translated into something mutable. I guess your definition of translation is perfect. I always map my enums to the primary key of a particular lookup table, or a translation code if necessary. I guess you see the point. Anyone else is welcome in this discussion. 2009/7/11, mantzas <[email protected]>: > > Another reason is for translation. Having the data in db gives an easy > way to present to the user different languages without the need to > compile. > > I was thinking maybe a code generation tool but everytime something > changes it must be generated and compiled... > > any other thoughts??? > > On 11 Ιούλ, 15:14, Kenneth Siewers Møller <[email protected]> > wrote: >> I'm actually curious about this as well. Typically I would use lookup >> tables >> for values having persistance meaning. States I put in enums as an >> example. >> There's always a problem mapping between these layers when talking about >> "static" data. >> Sometimes I have immutable lookup tables mapped to entities and enums, >> which, most of the time, won't change. The reason for using lookup tables >> are typically for reporting etc. with tools unaware of my business >> logic/model. >> >> 2009/7/11 mantzas <[email protected]> >> >> >> >> > Hi, >> >> > i have read some posts about enum in NHibernate (Maybe not all). >> >> > i.e. User Status: Active,Inactive,Locked... >> >> > Until now i have persisted the values in the db so the user has the >> > chance to crud the thing. >> >> > My though: >> >> > If the user cruds then the business meaning of the enum is lost. >> > Such enums must be hardcoded in order to have a business meaning and >> > can be used in code (A newly added user status is meaningless until i >> > use it in code, which means write code, build deploy...). >> >> > what do you thing? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
