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 ;-))