puremvc
|
 |
« Reply #1 on: May 14, 2009, 08:10:50 » |
|
Enums are generally written as you see them in the EmployeeAdmin demo. You don't create them from a database on the fly. The reason is if you're going to use static constants to refer to these values in your app, they can't be dynamic.
Like VOs, you typically write a client side version and a serverside version so that RemoteObject calls can pass them back and forth.
But the enumeration values don't change just because a new record is added to a lookup table in the DB. Unless you have middleware generating your enums and VOs, this is a manual task.
Adding new values to an enum class is just like adding new properties to a VO. It usually has three steps: database 'alter table', server class edit, client class edit.
Otherwise you're just dealing with rows of anonymous data and shouldn't be making any assumptions in your code about what the records contain. (i.e. making constants that refer to som data you expect to fetch).
-=Cliff>
|