-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: UI Design: Edit then List vs List then Edit
PostPosted: Sun Apr 30, 2006 12:14 am 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Today I was thinking about the way I build UIs (List the Edit) and the way most people I know build UIs (Edit then List) and the relation that the way you build you UI has with the way you store the data you manipulate in you UI.
So I wrote an article about that in my blog: http://luxspes.blogspot.com/2006/04/ui- ... -then.html
And would like to hear opinions about it... and perhaps get ideas to build some kind of framework on top of NHibernate that make it easier to manipulate persistent objects

I "created new UI patterns" to describe the different way a datamanipulating UI is tipically created... because I could't find an "official" name for this two ways of building UIs, I would love to hear of any book that deals with this topics and that gives this "patterns" an official name... of course, it is also possible that this shouldnt be considered patterns... in that case I would love to hear recomendations on how to call them.

I am also thinking about writing an small article about this in the Wikipedia, but for that I need sources to backup my article, and util now, i have not been able to find any... so I would appreciate any help on that...


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 01, 2006 12:52 pm 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Hi all!
I wonder why nobody has answered... perhaps the ways of building UIs that I describe in the article are not that common? Anyway... I hope someone makes a comment...


Top
 Profile  
 
 Post subject: Summary
PostPosted: Mon May 01, 2006 1:07 pm 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Here is a little summary of the article:

When you build a "data oriented" aplication (your typical mostly CRUD application) the workflow goes more or less like this:

List then Edit
-You see a list of objects (for example the catalog of products in amazon)
-You select an object and a windows to modify appears in front of you (you Edit it, to modify it propertys, for example when you select a Contact to change its address in Outlook)

or perhaps the UI follows Edit then List:
-You see an empty and disabled window that could be used to edit an objects, the only buttons that work are "new" and "search"
-If you click "search" you are presented with a window to search (the List) after finding the record you want to work with, you click "accept" in the List window
-You return to the Editor window that now is enabled and allows you to edit the selected record.

Sometimes, both views (the List and the Editor) are visible at the same time like in the Two-Panel Selector pattern (there is a link in the article in my blog)

After describing this two "patterns" the article focuses on how the way we chose to organize data oriented UIs affects the services our persistency mechanisms need to provide....

Do you think I should add screenshots to make things more clear?...
(I dont know if there is much common ground on this subject)


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 01, 2006 2:05 pm 
Senior
Senior

Joined: Fri Jan 13, 2006 2:50 pm
Posts: 123
Location: Blumenau / SC / Brasil
I've read your post, but I didn't understand some things:

Quote:
Persistence

The problem here, is that the user might want to see the same search results he used the last time, but each time we call the search List window, we are creating a new object, and all of the configuration from the last time we called it is already lost (this disadvantage has a "nice side", because we don't have to worry about showing "stale data" to our user)


You've noticed a nice point to think about!


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 01, 2006 6:36 pm 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Hi!
Thanks for posting!
I am not sure what do you mean by quoting:

Quote:
The problem here, is that the user might want to see the same search results he used the last time, but each time we call the search List window, we are creating a new object, and all of the configuration from the last time we called it is already lost (this disadvantage has a "nice side", because we don't have to worry about showing "stale data" to our user)


please tell me what you don't understand...


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 02, 2006 2:51 am 
Senior
Senior

Joined: Thu Aug 25, 2005 3:35 am
Posts: 160
I've read your post, actually subscribed to your blog now, but I don't think there is any common ground here. In no way would I ever allow my persistency mechanism to dictate the way I arrange my UI, and vice versa. Maybe when thinking about stale data, I can think of some scenario's.. yes.. But that is not a problem in our project.

We use the Two-Panel Selector pattern.
Data is loaded to the smart client in a disconnected fashion (no NH references are on the client machine).


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 02, 2006 2:01 pm 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Hi TheShark! thanks for answering.

Quote:
In no way would I ever allow my persistency mechanism to dictate the way I arrange my UI, and vice versa.


I agree that thinking that the persistency dictates your UI seems wrong... But tell me...
how do you handle the case of complex multiple level or nested interfaces? did you built an infraestructure (some house made framework) to help you? or do you solve in a case by case basis?

Now... about your UI dictating persistence... well it shouldn't happen, i agree with that, but IMHO it certainly influences persistence, but indirectly after all the save button has to be somewhere in you UI... and the UI sometimes even dictates the genereal architecture of your app (for example ASP.NET applications... I still havent seen an NHibernate example of an easy way to have a transaction spanning serveral requests, OpenSessionInView seems to dictate a transation per response/request cycle)...

Wait... take a look at the name of that pattern "OpenSessionInView"... the name itself is saying "your session will be controlled by your views" or "your persistence will be dictated by your UI"... :S

Quote:
Data is loaded to the smart client in a disconnected fashion (no NH references are on the client machine).


That sounds very interesting... i think the answer is along that way... but I have a lot of questions (I want to know what is common practice in that scenario)
how do you separate your persisted, from will be persisted, from i wanted them persisted but not anymore objects?
how do you demarcate your transactions? do you have a "client object context"?
how do you deal with performance problematic operations? (when you need, to for example, load 1000 objects to do something in memory, but you only want the result of the operation in the client?)
Do you have server side an client side objects? is your server side stateless? how do you avoid repeating yourself?
how do you handle validation? do you validate objects both in the client and in the server? is validation a part of you infraestructure? or you do it manually? do you use ErrorProviders?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 02, 2006 2:22 pm 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Hi The Shark... some more questions:

Quote:
We use the Two-Panel Selector pattern.


How do you transfer the object from the upper "List" panel to the lower "Edit" panel? i mean... are they both in the same from? or are they two different usercontrols embbeded in a form?
the object passes directly from the list to the edit? or you pass the primary key and then reload the object in the edit side?
if you do pass the object directly as you make changes in the "Edit" side they are reflected in the "list side" what do you use to "revert" the changes if you cancel the operation? do you use databinding?
do you disable the "List" while you are editing? or if it is clicked while you are editing you ask "the current object has changes, do you want to save them?" how do you know if it really has changes? you ask that to you UI? or to some kind of object context?


do you think there should be a framework to make all this easier?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 3:52 am 
Senior
Senior

Joined: Thu Aug 25, 2005 3:35 am
Posts: 160
Quote:
how do you handle the case of complex multiple level or nested interfaces? did you built an infraestructure (some house made framework) to help you? or do you solve in a case by case basis?


I have a house made framework. However, I'm transitioning to avalon now, and I'm redoing that framework to make it simpler.
Anyway, it is certainly not done case by case. I think of a form within my UI as a 'view' upon a specific part of my datamodel. Nesting does not apply there.

Quote:
Wait... take a look at the name of that pattern "OpenSessionInView"... the name itself is saying "your session will be controlled by your views" or "your persistence will be dictated by your UI"... :S


There will always be technical stuff to deal with. I'm doing a windows application (client/server) and not asp.net. However, the name implies that the session is kept open during the lifecycle of the view. Which means that the NH is not in your way while working with your objects during that lifecycle.
That said, in this case you are right. But I'm getting the feeling you haven't made your objects smart enough (more on that in the following remark.)

Quote:
how do you separate your persisted, from will be persisted, from i wanted them persisted but not anymore objects?


Make your object smart enough. That means, when getting the object from NH, use the interceptor to call a method/ set a property on that object so that you know it came from NH.
When you no longer want the object around, then set it as 'deleted'. If you can see that it came from NH, then it must be really deleted, otherwise it can be just discarded.
This can all be built into general purpose frameworks + a baseclass for the object or a strategy object.

Quote:
how do you demarcate your transactions? do you have a "client object context"?

No such thing. As I said, we have a client/server setup. Maybe that is different from typical asp.net usage, but it shouldn't be, really.
So, you have your disconnected object. You get back to the server with it (the codebehind) and you open up a session (already done with the sessionView thingy???). You attach the object, open a transaction and start doing your proces. Then close transaction.
Nothing special, I may have misunderstood your question.

Quote:
how do you deal with performance problematic operations? (when you need, to for example, load 1000 objects to do something in memory, but you only want the result of the operation in the client?)


Be pragmatic. Can it be done in a stored procedure??
If not, no worries. I don't see a problem here. If you only want the result in the client, then only send the result. Cache that 1000 objects if you are totally sure you are going to need them to proces the result from the client. Otherwise, discard.

Quote:
Do you have server side an client side objects?

I have domain objects that are shared. On the server side I 'wrap' them in proces objects for executing the logic (which i do not want to do on the client).

Quote:
is your server side stateless

Yes, obviously. Although I do use callbacks that allow the server to notify the client.

Quote:
how do you avoid repeating yourself?

Domain driven design. Proces objects that wrap the domain objects. Keeping client UI code to an absolute minimum by using a framework.

Quote:
how do you handle validation

Domain objects give back validation rules per properties. In the old framework, they were defined in attributes, now I use a 'GetValidation(string propertyname)' method. This is the way avalon does things as well.
The client framework just connects those rules to the UI.
On the server I can use the exact same validation rules to validate the object.
If there are server specific rules, that is stated in the rule, so they are not picked up by the client framework.
Yes, I use error providers.

Quote:
How do you transfer the object from the upper "List" panel to the lower "Edit" panel? i mean... are they both in the same from? or are they two different usercontrols embbeded in a form?

The list is usually a grid. When a row is selected, the Details below are shown. That is supersimple. Yes, I like to have a usercontrol for the detail panel. That is because I use polymorphism in my List panel, and so I can have differeny types there. I want to determine which detail panel I want to show accordingly.

I certainly do now reload the object. I have them ready.

You are thinking more about a search screen at this moment. If I have a search screen, I do not have full objects in the grid. Then there is a real 'action' provided by the user to choose that object. When it is such a purposeful action, I then load the object.

Again, winform UI is different from asp.net. In asp.net I would reload, but would heavily use the session cache from nh.

Quote:
if you do pass the object directly as you make changes in the "Edit" side they are reflected in the "list side" what do you use to "revert" the changes if you cancel the operation? do you use databinding?


The fields in my object or not privates, but are all in a struct. I databind against the public getter/setters. When the user starts to edit, the BeginEdit() method makes a copy of the struct. If he cancels his edit, the 'current' struct is discarded and the copy is put back.
This is how datasets are done as well.

Quote:
do you disable the "List" while you are editing? or if it is clicked while you are editing you ask "the current object has changes, do you want to save them?"


Yes and no. Make it easy on yourself.

Quote:
how do you know if it really has changes? you ask that to you UI? or to some kind of object context?


I also keep a struct that is the 'loaded' version. I can do a simple valuetype compare between the current and the loaded version to see if it is equal.

Quote:
do you think there should be a framework to make all this easier?


Yes, obviously. And i have one. I think it is indispensable and you should never attempt to solve things on the fly per use-case.


I hope the answers helped. Let me know by rating the answer ;-))


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 1:17 pm 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Hi TheShark!
Very complete answer... thanks... (but I have some more questions for you that I will post later ;) )
If someone else reads this thread, please dont think that because of the excelent answer from TheShark i have satisfied all of my curiosity, please, if you work in a similar or different way, say so.
thanks all.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 07, 2006 3:56 am 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
How do developers save? I know I know, after reading some of the comments on UI Design: Edit then List vs List then Edit ( http://luxspes.blogspot.com/2006/04/ui- ... -then.html ) I learned that most developers believe that the UI Design is a user concern, not a developer concern (build the UI as the user wants it, Not as the developer wants it)... but I have been wondering...

* Do the users really know what they want?
* Do the users really appreciate some of the internal behaviors the UI provides?
* Do all software projects have enough budget and type to make real usability test?
* Do all customers pay an amount of money for a project that justifies the extra effort of building a well designed UI?
* Do you as a developer have a framework that make all this issues moot and for you is so extremely easy to build a good UI that you always built it in the absolute best way?

For More On This... ( http://luxspes.blogspot.com/2006/05/ui- ... -save.html )


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]


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

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.