Ideally, you initialize by pre-loading all the mappings, by calling initialize(). You can also call storeMapping() whenever you know you have a new mapping -- on each translation if you like, though that's a lot of overhead.
Then you just use it to translate strings to numbers and back. The only twist comes when, for example, you have everything in a DB, and have to translate from numbers back into strings to make efficient queries. Then you have to override some methods in the DataModel implementation to deal with this. It's not one line of code but not terrible, and maybe we can find ways to make it easier. On Wed, May 19, 2010 at 1:10 AM, Matthew Bryan <[email protected]> wrote: > I'm having trouble setting up an IDMigrator. I start to write a > DataModel class with the overrides that do the translation through an > IDMigrator...but that technique doesn't provide a straightforward path > for the initialization of IDMigrator....unless I'm reading the db or > file natively before it's abstracted in the interface. Is this how > folks are doing it or am I missing something? Is there any sample code > for an IDMigrator implementation? Thanks for the help....this is a > great list for an exciting tool. > > Matt >
