Pages

Monday, May 17, 2010

PLAN, bindings by name?

PLAN is a small framework which I've developed in C++, so I can declare application's behavior in one place. At the time, it's immature. In the future I intend to add JavaScript support in my projects (Qt4 framework). That will allow me to get rid of C macros and do modifications and inspection at run-time.

It's quite obvious that I repeat object names in the below example. I'm thinking of implementing bindings by name in the future, thus duplicated and error-prone code will be removed.

PLAN(on-download-items, C_(*T*, markItemsModel) <<
                        C_(*T*, @on-download));
PLAN(on-download-bcItems, C_(*T*, markBcItemsModel) <<
                          C_(*T*, @on-download));
PLAN(on-download-clerks, C_(*T*, markClerksModel) <<
                         C_(*T*, @on-download));
PLAN(on-download-groups, C_(*T*, markGroupsModel) <<
                         C_(*T*, @on-download));
PLAN(on-download-departments, C_(*T*, markDepartmentsModel) <<
                              C_(*T*, @on-download)); 
//
PLAN(on-download, C_(~IsDlgMarked, *DROP*) <<
                  C_(*T*, disableDlg) <<
                  C_(*T*, downloadFile) <<
                  C_(*T*, enableDlg));
PLAN(on-file-downloaded, C_(*T*, @on-load-model));
PLAN(on-load-file, C_(*T*, OpenFileDialog) <<
                   C_(*T*, @on-load-model));
PLAN(on-load-model, C_(*T*, detachView) <<
                    C_(*T*, loadModel) <<
                    C_(*T*, attachView) <<
                    C_(*T*, customizeView));


By the way, if I tell you that I use dialogs and tables to display data, can you understand how my application behaves? Imagine that a button click can trigger a "on-download-items" event, for example.

No comments:

Post a Comment