Quantcast
Viewing all articles
Browse latest Browse all 6821

Using TDD and MVP Design Pattern

@TheGrovesy wrote:

I am in the very early stages of implementing a very simple game which i hope to develop using TDD (Test Driven Development), I am using Nunit for the TDD framework.

To test as much of the logic as possible I plan to use the MVP (Model View Presenter) design pattern to separate the testable logic from the graphics side. Its the MVP that I am a bit stuck on and how best to split my game objects.

At the moment I'm thinking I might have a ViewEngine which is pretty much the entry point on my game and instantiates all the other Views, which in turn instantiates their presenters and so on. Each game object (player, tiles, power ups, etc) will have their own view, presenter and model. I believe in good MVP the presenter should really be the main driving force of the game/application. Therefore I assume the presenters should be called using the 'Update' loop and the views should be called using the 'Draw' event. But I'm still unsure how to structure this.

Has anyone else done this or able to share some thoughts/ideas on what would be a good way to do this?

Posts: 5

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles