On Tue, Sep 05, 2006 at 03:33:36PM +0200, Abdelrazak Younes wrote: > >> char const * const dialognames[] = { > >> "aboutlyx", "bibitem", "bibtex", "box", "branch", "changes",... > > > >For this I'd actually prefer a factory that's initialized by static > >singleton or such. > > Could you elaborate a bit please? > The different dialogs are accessed with a string key. The key could as > well be an int without any difference in behaviour, that's what I mean.
The enum requires a place where all dialogs are known (at least conceptionally) so that we can define an enum { dialogFoo, dialogBar .... } With a factory (in an ideal world...) we could (in theory...) have a core completely ignorant of concrete dialogs. 'lfun-insert-inset foo' would just ask the factory to create a dialog by a generator registered under the name 'foo'. Andre'