Re: Database interaction



On Wednesday, April 28, 2004, at 11:11 AM, A. Pagaltzis wrote:

* Daniel Kasak <dkasak nusconsulting com au> [2004-04-28 01:24]:
I then go into glade and create entry fields, and call them:

[...]

Then I add my DB interaction object to the window. When the windows opens, I call the 'refresh' method, which looks at it's SQL and DB string and fetches the data via DBI. It then looks at the list of fields is has, and looks at the fields that are on the same window that it's on, and sets their value accordingly. See how it saves programming time?

not hard to do, just involved. the "interaction object" would ask the dbm to describe the table up front so it knows how to deal with each column, and then use a separate worker object, customized for that column type, to do the actual work for each column.


That sounds backwards to me. You haven't automated very much; you still have to manually create a form for every single table.

If I were to tackle this, I'd write a container widget which is given a list of fields (and their data types), which then automatically instantiates suitable widgets for all the fields.

if you separate the low-level "bind this widget to this table's column" and "update/commit these widgets from/to their associated columns" logic into one set of objects, then you are mostly finished.

you can create a generic container that can work on any table and just provide a tabular view (column names on the left, editor widgets on the right), and use that for any table. then for customized user interfaces you create a form in glade, and use the same low-level tools to bind the widgets to that custom form.

the ability to hook these things up to forms created in glade is really important; some tables are well suited to a simple tabular layout, but others *really* need something more specialized, even if it's just to re-order and re-group widgets.

so, really, all of the important work is in the proper definition of the low-level api and functionality.


Of course, no such widget exists..

that sounds like a great opportunity for someone seeking gtk2-perl fame and glory... :-)

--
"Quit hittin' yourself!  Quit hittin' yourself!"
   -- Elysse, playing with a newborn baby.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]