Hichem-elAbassi / j4me

Automatically exported from code.google.com/p/j4me
0 stars 0 forks source link

Initializing a main menu #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi guys,

a lot of thanks for your great work on J4ME.

It's really respectable.

But could it be that initializing of the main menu per (e.g.)

        TextualInfo ti = new TextualInfo( menu );
        menu.appendMenuOption( ti );

will instantiate all layers of this Dialog/DeviceScreen?

Or have I missunderstood the examples?

Best regards, Uli

Original issue reported on code.google.com by z...@gmx.com on 26 Jan 2008 at 8:49

GoogleCodeExporter commented 9 years ago
I'm not actually sure what your question is.  The above code will call the
TextualInfo constructor, which I assume derives from Dialog.  So in turn Dialog 
and
DeviceScreen's constructors will get called.  That is all minimal.

Most of the code is executed when the user clicks on the menu option.  That 
invokes
the .show method and eventually the .paint.  Those initialize the layout and 
other
goodies.

I don't think this is a bug, but let me know if I've misunderstood something.

Original comment by deanbro...@gmail.com on 12 Feb 2008 at 12:18

GoogleCodeExporter commented 9 years ago
(Light and shadow stand together in the door.)

Sorry, I suffer from a little paranoia concerning memory and runtime 
consumption.

My opinion is now(after further studying of the sources):

When your had choosen an other design as binding the instances of Dialog or
DeviceScreen early at the Menu -->
there wouldn't be this excellent navigation through the Dialogs without this
permanently getCurrent/setCurrent.

(A really sophisticated solution!)

The problem of the memory consumption of the business layer can be solved by
implementation of some kind of presentation layer in the show/hideNotify 
methodes.
Which instantiates and frees the visual components and the business classes.

OK + thanks, Uli

Original comment by z...@gmx.com on 14 Feb 2008 at 5:36

GoogleCodeExporter commented 9 years ago
This is not actually a problem as the discussion indicates.  Our initialization 
is
actually the same pattern used by the LCDUI so it is at least no worse than 
other
options :)

Original comment by deanbro...@gmail.com on 25 Feb 2008 at 8:37