Reputation: 1772
Is MVP considered best practice for *all* GWT applications?
Upvotes: 4
Views: 279
Reputation: 531
I can see merit in the MVP paradigm, but for myself I prefer not to have an extra presentation layer between the model and the GWT specific view classes. I make sure to rigorously keep all business rules out of the view classes (the UIBinder stuff), and put it in the model classes instead.
Likewise I keep all GWT.create(..)
stuff out of the model. This lets me access the model classes on the server-side without hassle. I then use SyncProxy a lot in my JUnit tests for the RPC calls.
Ultimately, when you´re writing a rich web client, you can´t rely too much on automated testing of the view, especially not when it´s rendered by generated code for a variety of platforms (i.e. browsers). The proof of the pudding is in what Internet Explorer, Firefox and Chrome makes of it.
Upvotes: 1
Reputation: 7253
MVP decouples development in a way that allows multiple developers to work simultaneously
Upvotes: 7
Reputation: 3268
Well it's subjective, design stuff are always trade-offs.
Although the scope/size/future of small apps is also debatable, we usually keep things simple for small apps to reduce complexity or avoid killing fly with a canon
However, if your team is already comfortable with MVP, I would strongly recommend to go for MVP because as it's size will increase, pattern will help you avoid spaghetti code.
Upvotes: 2
Reputation: 26354
Not using MVP does not necessarily mean not-testable. You can always test your app through the UI using automated testing tools, but those are harder to write and more fragile. If your application is complex, or you need to maintain it, making it unit testable will pay on the long run.
Upvotes: 1