Hi Konrad,

> If I'm understanding this correctly the simple way to do this is to
> put the logic for each page in its own file. so instead of (de report
> ..) I would have a report.l file that just contains the guts of what
> I'm coding.

Right.

The family demo program is not a good example for that, as it puts for
simplicity everything into a single file, and uses functions for each
object GUI frame instead of external files.


A better example is the "app/" demo. All our production apps follow this
layout. There is a "main.l" which loads the system libraries, contains
some global definitions, and loads app-specific "er.l", "lib.l" and
"gui.l" files. These files change rarely after the first version of the
application is done.

But if the model in "er.l" changes, it is better to stop the server,
delete the database files, and start again (resulting in the execution
of the init code). This is easier than doing the model changes
in-memory, and editing the database to reflect the new structures.

When "lib.l" (general utility functions) and "gui.l" (the menu structure
dialogs, and other GUI related functions) change, I simply enter (load
"xxx/lib.l") in the REPL. Or I use (edit 'foo) followed by a (ld).

90 percent of the application code resides in object GUI forms (e.g. in
the "app/" demo these are "role.l", "user.l", "sal.l", "cusu.l",
"item.l" and "ord.l") and other pages (most typically reports or special
actions like data im- and exports). For these files, nothing at all has
to be done. I just reload the page in the browser.

To keep some context in such files, I often use 'once' to avoid repeated
code execution. Other 'load'ed code takes care to avoid repeated effects
by using 'push1' instead of 'push' (as in e.g. "lib/form.l" and
"socialshareprivacy/lib.l") and similar measures. In that way I try to
organize each file (except "er.l") in such a way that it can be
re-loaded at any time.


> Reloading model.l is not really an issue for me. Besides at the moment
> if it does change ir porably means that the underlying database also
> needs to be nerfed and recreated becasue I've made large changes to
> the the entity structures. THough this is not likely at this stage

Exactly.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to