If you use MVP, you might use some kind of factory for your objects, like the PlaceController. The best is to use dependency injection for this (with Gin). The PlaceController is Injected in the Activity (or in your custom factory).
When it comes to testing, you can use a special factory (or injection) that implements a Testable PlaceController) 2011/8/17 tanteanni <[email protected]> > On of the main advantages of MVP-patrtern propagated is testability because > if implemented "correctly" there is no need for GWTTestCase. But if i use > MVP in conjunction with "activities & places" - meaning presenters become > "activities" - this advantage seem to gone?! Beeing a presenter and activity > at the same time means knowing something about PlaceController - to go to > other places or to deserialize the state of current place. (If > PlaceController is involved the need for GWTTestCase arose.) > > At the moment i see some alternatives: > - testing the "old" way with GWTTestCase > - separating activity and presenter (separating navigation logic from > business-logic, the pattern is know "MVPA") > - make activity more testable (how? give a null-PlaceController in > constructor?) > > My Question is: Is there a best or at least good practice to test/implement > such presenters? (the first 2 alternative are the worst in imho) > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-web-toolkit/-/3_fACom4yUEJ. > 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/google-web-toolkit?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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/google-web-toolkit?hl=en.
