"1-You can just the Id from the Browse Product presenter to the Edit Product." I guess you was going to write: You can just pass the Id from the Browse Product presenter to the Edit Product presenter. Well it doesn't matter what i pass, whole product or just ID, i can always reread it from current presenter|session. The problem is how to pass information between presenters, as i said i don't want to expose presenters to presenters.
2) I have studied your Chinook Media Manager, nice architecture but unfortunately it doesn't show how to solve my situation, basically as i understood you do all main work in one session "AlbumManagerModel" and u close it only on "save all" or "cancel all". When you load artist you close session after it and load almubs in new View using new session, track editing goes in same AlbumManagerModel session. I'm my case when i load my Products, 1) i need to stay List session open 2) I need to display Product details in same view (that all hapens in 1 prsenter|session) When i edit Prpoduct i do it in new view|presenter|session, and i have to reload this product passed from ListVIew in EditView session, when i save it i need to reload it in ListView etc etc. My actual model is pretty complex i have about 16 interconnected Entities with duplex associations, so far i have done only 3 entities and it's already produce lots of in-memory \ view sync problems and persistent problems, i will be unable to hold all this working with all my model implemented. So now i see only 3 options for me: 1) Load all my ObjectGraph in memory and work with it (not good it will consume about 700MB of memory) 2) Invent some kind of smart object like smart pointers in C++ which will auto manage session. 3) Think more ) On Dec 22, 5:30 am, José F. Romaniello <[email protected]> wrote: > 1-You can just the Id from the Browse Product presenter to the Edit > Product. > 2-You can share the same session. If you are using unhaddins, you can use > model per use case, maybe your use case involve browse and edit.. Then you > will have a Model named ProductsAdministrationService. Recently I figure out > that this is called in DDD, "Application Service". You can see an example in > my Chinook Media Manager, is WPF but this artifact is equal in winforms: > > http://code.google.com/p/unhaddins/source/browse/trunk/Examples/uNHAd... > > <http://code.google.com/p/unhaddins/source/browse/trunk/Examples/uNHAd...>Recently, > I figure out that having browse and edit in the same conversation is not so > good. So, I will recomend you the former solution, share Ids... > > 2009/12/21 Broken Pipe <[email protected]> > > > First, guys i would like to thank you for answering my previous post > > about "Session Management". Information you gave was really helpful. > > Now i need help on related problem.. so > > > Situation: I have a WinForms app with MVP pattern applied, and i have > > 2 simple Views in it: > > 1) Showing Product list (lets call it "List View"), > > 2) Edit\Add Product View (lets call it "Editor View") > > I'm using Session-Per-Presenter pattern in this App. > > > The Problem: I can't update entities passed from one presenter to > > another, as you may guess I'm getting "Illegal attempt to associate a > > collection with two open sessions" Exception. > > > Well you can say that this is Session management problem, but i will > > disagree with you, it's my MVP implementation problem. (You may wonder > > why I'm posting this question here then, well i don't know other > > places where someone use Nhibernate with MVP, and you have nice > > examples in uNhAddIns) > > > The problem is how i pass Product which need to be edited to Editor > > View: > > I'm currently do it like this: > > void EditProductClicked(object sender, EventArgs e) > > { > > IProductEditorView EditorView = > > IoC.Get<IProductEditorView>(); > > EditorView.Product = > > Model.GetRepository<Product>().SingleBy(t => > > t.id == View.CurrentProduct.id); > > //I can do EditorView.Product = View.CurrentProduct but the > > result > > will be the same anyway this entity is loaded in this presetner and > > ISession > > IoC.Get<IViewManager>().ActivateView<IProductEditorView> > > (IProductEditorView); > > } > > > How to pass data between Views? I read lots of materials on MVP (All > > blog's i could find, book "Architecting Microsoft® .NET Solutions for > > the Enterprise" there is whole chapter on MVP there, but no where i > > could find info about MVP triad communication, the only article that > > tries to cover this topic somehow is "Humble Dialog Box V2" but even > > there author don't pass data from main view to child view. (i was very > > disappointed about it) > > > I understand my problem but i can't find good way to solve it. > > I don't want to expose Presenters to other Presenters, ie i don't want > > to do: > > IoC.Get<IProductEditorView>().Presenter.SetProduct > > (View.CurrentProduct) //and load this product on other side from > > Model. > > > I would appreciate any help, I'm struggling with MVP+NHibernate for > > more then 170 hours already. > > > -- > > > You received this message because you are subscribed to the Google Groups > > "nhusers" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<nhusers%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/nhusers?hl=en. -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
