I'm porting a winform csla app to asp.net and I've come across an issue I'd appreciate any advice on.
In the winform app we have edit forms for objects, let's say the object is an invoice. In that invoice form we have a client, that client is a drop list with a button that can open a client entry form to create a new client in a popup form so that the user doesn't have to leave the stuff they are editing on the invoice to create a client nor to have to create a client before creating a new invoice.
On that client entry form is a client group selection which has a button which opens a client group for editing or creating a new one etc etc.
In the winform app this scenario can go as many as 5 levels deep (i.e. 5 modal popup forms potentially) from the first main object being edited.
I want to replicate that behaviour in the asp.net app, but if I cache the initial Invoice object in session under "currentObject", the user edits some fields in invoice then decides to make a new client for that invoice so they click on client and another page pops up to enter the client, in theory I put the client in the currentObject slot in session, overwriting my Invoice object that was half edited previously.
In the original CSLA 1.x each type of object was cached separately in session, I can see the value in switching to a single session object, but this is an isssue in my case. I've considered that I know I only need to go at maximum 5 levels deep so I could have 5 currentObject slots, but then I need a whole system to manage what is in where and it starts to get out of hand. Going back to a separate session variable per object seems like a bad idea.
Wondering how others handle this sort of thing or if I'm not thinking about it correctly / going about it the wrong way.
I don't think I explained the situation very well, this has nothing to do with n-level undo, I've never used that functionality even in the winform app. Think of it like editing one object then needing to add and edit another object while in the midst of editing the first object so that you can select it on the first object.
Or put another way, if I have only one "currentObject" in session I have a problem when the user is editing two different objects "simultaneously". If I go back to the original CSLA 1 method of using a different session variable for each type of object it would solve the problem, but I'm trying to see if there is another way to better accomplish this before I resort to that.
hi
I wrap my session objects conceptually in "context" classes. This way i can group similar objects which fall under one logical group and dispose them together. For eg. all customer related info would be in a CustomerContext class, an object of which would hold customer related variables in session. this is a simple and easy to manage technique which i find very useful.
in yr case yr Context class can have a hold a reference to other context class.
thanks
Viv
vicky_iit:I wrap my session objects conceptually in "context" classes. This way i can group similar objects which fall under one logical group and dispose them together.
Hmmm..yes, interesting that gives me some ideas, thank you!
Copyright (c) Marimer LLC