From: <pef...@fe...> - 2001-11-03 00:23:52
|
Has anyone given any thought to putting "hints" in a database for viewing records? AFAIK, records are currently displayed as a list of fields going down the page, with each field consisting of a label and a matching entry field. It would be nice to at the very least have "headers" which would group items. For example, if I'm converting a paper form that has a layout like this: Foo Number ___ Size ___ Quality ___ Bar Number ___ Size ___ Quality ___ Then I end up converting it to a flat db format like this: Foo Number ___ Foo Size ___ Foo Quality ___ Bar Number ___ Bar Size ___ Bar Quality ___ Now this makes sense; each record is unambiguous, and if I want to pull the database into another program, I can "unflatten" it by pulling the "Foo" and "Bar" off the front. However, it doesn't look very nice when running the DB app. Specifically, the field names can get extremely long and become confusing. I'd like to be able to have a database that is flat, but with hints that tell it to display with some primitive grouping. I think this could be done with the following features: - implement a syntax for displaying field names; this could be as simple as hiding parts in brackets. So [Foo] Number would be displayed as "Number" on screen, but a DB-aware application would still unambiguously know it. - implement a field type of "null" or "label" which did not actually have a data item in each record, but would be displayed in the record table using only its name. Using these features, a CSV metadata file might look like: field "Foo" label field "[Foo] Number" integer field "[Foo] Size" integer etc. It would also be possible to get away with only one of the features. If you didn't have a syntax for displaying field names, then you could just cut your field names down and group them contextually with labels. However, you would probably end up with ambiguous names, which makes "view" lines fail, and would make the database less robust when exporting (I'm not even clear on whether the db format would support ambiguous names at all). If you didn't have labels, you could actually steal the information from the bracketed field names. A simple algorithm would be to display a heading for any field - that has a bracketed name - whose bracketed name is different than the last bracketed name So: field "[Foo] Number" integer field "[Foo] Size" integer field "[Bar] Number" integer field "[Foo] Quality" integer would be displayed as: Foo Number ___ Size ___ Bar Number ___ Foo Quality ___ Anyway, I'm interested to see if this has been discussed before, if there's another way to do what I want, if anybody has any comment on the ideas, etc. If I don't get any negative feedback, I'm going to go ahead and implement it, probably with bracketed names implying labels. -Peff |