1. Is it considered an overkill for console application to be design like MVC , MVP or N tier architecture? If not which is more common and if you can link me to simple example of it.

  2. I want to implement a tic tac toe game in console application.
    I have a solution which hold two projects: TicTacToeBusinessLogic (Class library project) and TicTacToeConsoleApplication (Console application project) to represent the view logic. In the TicTacToeConsoleApplication I've Program.cs class which holds the main entry point (public static void Main).
    Now I face a problem.
    I want the game to handle its own game flow so I can: Create new GameManager class (from BL) but this causing the view to directly know the BL part.

So I'm a little confused how to write it in an acceptable way. Should I use delegates? Please show me a simple example.

  • +1 because someone down-voted your question without any explanation :-/ – Heliac Mar 15 '16 at 8:45

I would at the very least go with something where you have one layer that listens to keyboard etc. events and translates those into calls into the game logic layer and gets updated (Observer) as those calls change the state of the game.

Take it a few steps further and guess what, you are back in MVC or MVP or MVVM territory.

Whether or not to go with any of these patterns has nothing to do with the type of UI, and everything to do with separation of concerns, loose coupling and maintainability.

  • I don't know MVVM but as far as I know MVC or MVP is designed by separating the parts causing the parts to be somewhat loosely coupled and therefore more Maintainable and testable. – JavaSa May 31 '14 at 9:52
  • @JavaSa: Yes and so is MVVM. Sorry, but I don't understand what point you are making or what question you are asking with that comment. – Marjan Venema May 31 '14 at 10:01
  • Ok so, if I understood you correctly, you are basically telling me that Observer pattern is enough if I implement only "View" and "Model" parts and making them loosely coupled. But If I want to do one of the MVP,MVVM or MVC its more complicated and Observer pattern won't be enough? – JavaSa May 31 '14 at 15:10
  • What would you call the part that acts as the go between between the view and the model? The part that lets the model know what the user did and implements the observer to update the view? What I am saying is that as soon as you set the first step towards achieving separation of concerns, you might as well follow a well established pattern like MVC, MVP or MVVM, because that is where you are going to end up anyway if you do it properly. – Marjan Venema May 31 '14 at 16:47

The choice to use MVC or alike depends to my opinion on the size of your application and not on the kind of UI.

The bigger the complexity and size, the more you want to work in a structured way, using a design pattern. Of course, the used method should not give more overhead than benefits. But keep in mind thad code tends to grow in size and complexity very fast.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.