 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Robert Cram Guest
|
Posted: Wed Dec 01, 2004 11:56 am Post subject: Re: A grid is a bad thing in OO apps? |
|
|
José González D'Amico wrote:
| Quote: |
Some time ago I started digging more deeper in the Delphi OO world,
specifically researching about OPFs. When I looked at the UI layer, I
found that most OPFs avoid data-aware controls to get a clean OO
design.
My obvious question then was: what kind of controls they use for
displaying objects? Looking at papers discussing these OPFs, I found
for example TEdit's, TListView's, TTreeView's, etc. used, but never a
grid! (I'm
not talking about TDBGrid, rather a TStringGrid or similar)
Is a grid a bad thing from the OO design point of view? I find that
most users are accostumed to them, it seems natural to see tabular
information.
Thanks for your comments
|
I don't think a grid is is a bad thing from the OO design pointof view.
it can get a bit complicated though ;)
In quite a few cases I use a grid control to visualize many to many
relationships. Columns represent (some) objects from class A, rows
represent (some) objects from class B. In the gridcells you can edit
the association class. Makes a very nice interface for the user.
|
|
| Back to top |
|
 |
Roman Kaßebaum Guest
|
Posted: Wed Dec 01, 2004 12:37 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
José González D'Amico schrieb:
| Quote: | Is a grid a bad thing from the OO design point of view? I find that
most users are accostumed to them, it seems natural to see tabular
information.
|
In our applications we use an OPF. Naturally, some data should be shown
in grids.
Therefore we use the orpheus grids which don't store data. The grids
have an event OnGetCellData where you can give the data.
The disadvantage of the orpheus grids is that they often use pointers.
That's why they probably don't work under .net.
As a tree view we use the virtual tree view which also doesn't store data.
--
Roman
|
|
| Back to top |
|
 |
Marc Rohloff [TeamB] Guest
|
Posted: Wed Dec 01, 2004 12:41 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
On 1 Dec 2004 04:25:23 -0700, José González D'Amico wrote:
| Quote: | Is a grid a bad thing from the OO design point of view? I find that
most users are accostumed to them, it seems natural to see tabular
information.
|
I have heard this theory before. In fact I have been told that grids
come from hell. My question is which gives you the better UI since
this is more important at the end of the day.
We are all used to filling out tabular information.
The alternative is generally some sort of list where you then go to
the bottom of the screen or to some sort of pop-up window to edit the
data. To me this is just plain bad since it means the user has to move
their concentration somewhere else. The only problem is when there is
too much information to fit well in the grid, so I usually use a
combination.
--
Marc Rohloff [TeamB]
marc rohloff at myrealbox dot com
|
|
| Back to top |
|
 |
Bob Dawson Guest
|
Posted: Wed Dec 01, 2004 12:52 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
"José González D'Amico" wrote
| Quote: | that most OPFs avoid data-aware controls to get a clean OO design.
|
Not entirely. I'd say rather that most OPF writers/users avoid an unbroken
chain from DB to UI.
So for example an OPF is not generally going to allow a grid with an
underlying query with liveupdate. What you will find is a query that
supports creation of an object collection, and that collection being able to
represent itself as an in-memory dataset that can fill a grid. Our apps use
the DevEx grid extensively--they're just not linked to queries, but
datasets. TClientDataset works for this, as does the DevEx TdxMemData or the
excellent and free kbmMemTable.
| Quote: | Is a grid a bad thing from the OO design point of view?
|
Not at all, it's just in OO work the grid is only data-aware if it's linked
to an in-memory dataset, not the database, and relies on the objects and
object collection rather than bypassing them.
| Quote: | I find that most users are accostumed to them, it seems natural
to see tabular information.
|
Quite agree. Whether editing directly in the grid is supported is a separate
question. <g>
bobD
|
|
| Back to top |
|
 |
Joanna Carter (TeamB) Guest
|
Posted: Wed Dec 01, 2004 12:54 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
"José González D'Amico" <joseigd-GOODBYE (AT) SPAM-argentina (DOT) com> a écrit dans le
message de news: [email]41adb833 (AT) newsgroups (DOT) borland.com[/email]...
| Quote: | Is a grid a bad thing from the OO design point of view? I find that
most users are accostumed to them, it seems natural to see tabular
information.
|
IMO a grid is not necessarily a bad thing, it just depends how you implement
it.
A lot of folks use it as a read-only browsing widget.
I have also used it as an editing widget by thinking of it like this :
1. The Grid as a whole is a View on a List whilst browsing.
2. Each row of the grid is a View on a single object with each cell in that
row becoming a View on the property that it represents.
You need the concept of Current Row that reflects the currently selected
object from the list.
Using this idea, you should be able to create an edit for use by the cells
that has the same behaviour as any other regular edit.
If the grid already provides its own editing behaviour, you can intercept
the creation of the in-place edit and create a Wrapper or Adapter edit class
to 'convert' the in-place behaviour to the expected behaviour for your
standard property edits.
Joanna
--
Joanna Carter (TeamB)
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
|
|
| Back to top |
|
 |
Jim Cooper Guest
|
Posted: Wed Dec 01, 2004 2:24 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
José
| Quote: | Looking at papers discussing these OPFs, I found for
example TEdit's, TListView's, TTreeView's, etc. used, but never a grid!
|
Well, a TListView can be considered a type of grid, really
| Quote: | Is a grid a bad thing from the OO design point of view?
|
Not in and of itself.
They have definitely been overused as a UI paradigm from time to time
though :-)
I agree with Bob that making grids editable is a separate issue :-)
Cheers,
Jim Cooper
_______________________________________________
Jim Cooper [email]jim (AT) falafelsoft (DOT) com[/email]
Falafel Software http://www.falafelsoft.com
_______________________________________________
|
|
| Back to top |
|
 |
Franz-Leo Chomse Guest
|
Posted: Wed Dec 01, 2004 2:58 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
| Quote: | Is a grid a bad thing from the OO design point of view? I find that
most users are accostumed to them, it seems natural to see tabular
information.
|
It is not a bad thing from the OO design point it is a bad thing from
a DB access design point.
The basic data access returns a unidirectional result set which
has several disadvantages, when combined with a grid.
1. Grid operations need additional management information
like position and size of the result set, which is only
stable when you are working with a snapshot.
2. Since you can only move forward you have to buffer
the data on the client also, since a grid user normally scrolls
in both directions.
3. Buffering increases the problems for finding the right record
for updates and synchronizing with parallel actions by other
users.
Regards from Germany
Franz-Leo
|
|
| Back to top |
|
 |
Bob Dawson Guest
|
Posted: Fri Dec 03, 2004 12:28 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
"José González D'Amico" wrote
| Quote: |
Bob and Jim, this is what you implied as not OO-friendly? (if I
understood well the "separate issue")
|
Essentially, yes. Grids were not really designed for OO programming--they
were designed for direct data manipulation--so adapting them to work well as
object manipulators can be extraordinarily complex. When you get done the
results may not be close enough to 'normal' grid action to make the effort
worthwhile, and it's almost impossible to be sure you've trapped and handled
every possible data manipulation in a consistent way. What appears to be
happening in the GUI and what's really going on in the OO layer are just too
different.
Much, much easier to use a call-out frame where the current item of the grid
can be edited and the changes then applied to the grid as passive receiver,
or in the case of mass actions to exteriorize the operation on a collection
selection, and then update the grid afterwards. The grid is a great
browsing, grouping, navigation, and selection device. It need not be an
entry device.
bobD
|
|
| Back to top |
|
 |
Joanna Carter (TeamB) Guest
|
Posted: Fri Dec 03, 2004 12:54 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
"José González D'Amico" <joseigd-GOODBYE (AT) SPAM-argentina (DOT) com> a écrit dans le
message de news: [email]41b0519c (AT) newsgroups (DOT) borland.com[/email]...
| Quote: | One more question on making grids editable.
Bjørge Sæther wrote:
Also, programming a grid is hard because there is a lot of actions
that may be performed directly (Delete by Ctrl+Del, Insert by
Ctrl+Insert, etc.). Also, navigating may cause action invokation,
only controllable by the grid internals.
Bob and Jim, this is what you implied as not OO-friendly? (if I
understood well the "separate issue")
|
As well as using a 'proxy' edit to link to a property of an object, the
navigation keys are captured in separate interactors: one for the list and
another for the current object.
So, for example, Ctrl-Del is intercepted by the list interactor and fires
the list deletion, but left and right arrows are handled by the object
interactor setting the active property on the object.
Joanna
--
Joanna Carter (TeamB)
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
|
|
| Back to top |
|
 |
Leonardo Pasta Guest
|
Posted: Fri Dec 03, 2004 4:34 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
Hi Jim,
I am curious to know how you design Master/Detail interfaces for your
objects, like an Order/OrderItem.
Usually I design my OrderItem as a Grid, but I still doesn´t use OO
in my (production) apps.
Thanks,
Leonardo Pasta
Jim Cooper wrote:
| Quote: |
Bob and Jim, this is what you implied as not OO-friendly?
Partly. I also have an issue generally with editing in grids - I
think it is not very often appropriate. The only time I would even
consider it is if all the values fit nicely in the grid without a
horizontal scroll bar being required. I generally only like to have
one way top edit a given value, and I like to be consistent how I do
that throughout an entire application.
|
|
|
| Back to top |
|
 |
Jim Cooper Guest
|
Posted: Fri Dec 03, 2004 4:51 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
| Quote: | Bob and Jim, this is what you implied as not OO-friendly?
|
Partly. I also have an issue generally with editing in grids - I think
it is not very often appropriate. The only time I would even consider it
is if all the values fit nicely in the grid without a horizontal scroll
bar being required. I generally only like to have one way top edit a
given value, and I like to be consistent how I do that throughout an
entire application.
Cheers,
Jim Cooper
_______________________________________________
Jim Cooper [email]jim (AT) falafelsoft (DOT) com[/email]
Falafel Software http://www.falafelsoft.com
_______________________________________________
|
|
| Back to top |
|
 |
Jim Cooper Guest
|
Posted: Sat Dec 04, 2004 3:27 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
| Quote: | I am curious to know how you design Master/Detail interfaces for your
objects, like an Order/OrderItem.
|
Usually I use a grid or similar (there has been a bit of a trend for
listviews in my recent projects) for display. Orders and order lines are
a good example. Very often order lines have quite a bit of detail
associated with them, certainly more than is displayed in the order line
list/grid. In those cases I use the grid purely for navigation, and have
an embedded form (I don't really like frames) displayed with the values
getting updated as the user changes lines.
Cheers,
Jim Cooper
_______________________________________________
Jim Cooper [email]jim (AT) falafelsoft (DOT) com[/email]
Falafel Software http://www.falafelsoft.com
_______________________________________________
|
|
| Back to top |
|
 |
Joanna Carter (TeamB) Guest
|
Posted: Sat Dec 04, 2004 3:40 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
"Jim Cooper" <jim (AT) falafelsoft (DOT) com> a écrit dans le message de news:
41b1d777$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Usually I use a grid or similar (there has been a bit of a trend for
listviews in my recent projects) for display. Orders and order lines are
a good example. Very often order lines have quite a bit of detail
associated with them, certainly more than is displayed in the order line
list/grid. In those cases I use the grid purely for navigation, and have
an embedded form (I don't really like frames) displayed with the values
getting updated as the user changes lines.
|
Just an idea...
How about having the grid in place on the form for navigation only and when
you press Ctr-Insert for inserting or Ctrl-Enter for editing, the grid is
'replaced' by a full record editing panel for the currently inserted/editing
object ?
When the object is accepted/cancelled the area occupied by the 'editor'
reverts to showing the grid.
Comments ?
Joanna
--
Joanna Carter (TeamB)
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
________
|
|
| Back to top |
|
 |
Jim Cooper Guest
|
Posted: Sat Dec 04, 2004 3:45 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
Hmmm, I dunno, I think I'd have to see it in action.
Cheers,
Jim Cooper
_______________________________________________
Jim Cooper [email]jim (AT) falafelsoft (DOT) com[/email]
Falafel Software http://www.falafelsoft.com
_______________________________________________
|
|
| Back to top |
|
 |
Andrea Raimondi Guest
|
Posted: Sat Dec 04, 2004 6:52 pm Post subject: Re: A grid is a bad thing in OO apps? |
|
|
Joanna Carter (TeamB) wrote:
| Quote: | A lot of folks use it as a read-only browsing widget.
|
I, for one, use a data-aware grid when I simply need, for example, to
search in a bunch of records and display results( no editing needed ).
Otherwise, I much more prefer a listview - non data-aware.
The main problem with grids( imho ) is that they're not flexyble
enough to be able to be customized the way you might need.
That, imho, applies for practically *all* grids I have come
across.
Andrew
--
Online thoughts blog
http://araimondi.blogspot.com
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|