.net - Avoiding mass propagation of properties and events for exposure to ViewModels -


I am developing an MVVM application which is evolving at that point where I am ready to start collecting a user interface. (

My client code is fairly functional)

I'm running on this issue now That I am trying to get my application data where I need it so that it can be consumed by the visual model and then forced to do the scene, unfortunately, it seems that I have some structural oversight , Or I just have to face the reality that I The excessive amount of model errors require raising to inform the promotion of events and scenes that have changed their properties.

I should go to some examples of my problem:

I have a class "unit" contained in a class "test", "session" contained in "test manager" which is " TestDataModel "is used by" TestViewModel "which is the database by my" testview ".... WHOA

Now, consider that there is a property of the unit (under Herarići) which is called "the result" which is updated from time to time, I want to expose it to my vendoland and then In my opinion, trouble, the only way I can actually think of doing this is to keep up a chain to keep events that say "I have been updated!" And then request new value ... it seems like a grateful way to do this. Alternatively, I can register a static event and extend it, and can appropriately request the "Unit View Model" to grab the event and request updates. It looks better ... but ... steady incidents? Is this a taboo idea?

In addition to this, such an expression is taking place:

  TestDataModel. TestManager.Session.Test.Unit.Results [i] looks really gross on a visual model .  

I know that reeks all of a bad design issue, but I can not understand what I did wrong? Am I using more singleton / container controlled lifespan type objects? Register object instance with static assistant container? Maybe a multitain? Obviously these are difficult questions to answer without intimating with existing questions, but if you take part in such situations, then what do you do for a refactor? Should I just stick with it, add mass events, and motivate them?

The problem is that your TestView tries to know everything about your model, in fact you Want to think simple and more complex people want to use the structure to collect them. In this way you can see a scene related to only units and some other (other ideas will deal with other aspects of your larger model). Thus your view models will reach the model through a well defined API (for obtaining units for example). .) And no person will need to violate the encapsulation of their model by highlighting all their interior.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -