1

I am currently working on a little MonoGame project. While planning this, i came to a problem: I want to separate the game logic to an other assembly. The client and the server need this logic assembly, the client can also start a server.

My question is now: should i separate the server in an specific assembly, or should i reference the server executable in my client project?

Here is a diagram, to visual my question:

enter image description here

If you want to see the source code, you can check it out here.

Edit: To make it clear:I read this question on stackoverflow and thought, an executable server, shipped with the client could make a separate assembly for the common code obsolete.

Edit2: As Robert Harvey wrote in the chat, i should still separate them. I will do this and add an answer, once available for me...

8
  • 1
    Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask
    – gnat
    Commented Aug 11, 2015 at 19:18
  • 1
    @gnat I don't know if the source code would helps you, because it doesn't have any 'server logic', but i made a diagram : )
    – Alex H
    Commented Aug 11, 2015 at 19:22
  • 1
    Only create a common assembly if you actually have code that you want to share between the two assemblies for DRY purposes. Commented Aug 11, 2015 at 19:28
  • @RobertHarvey I Have common code. That is not the problem here. A good advise, but i have to share IDs and such.
    – Alex H
    Commented Aug 11, 2015 at 19:31
  • 1
    It really depends on what your goals are. People write View Model objects all the time to achieve decoupling, but in practice these objects can live in any assembly that is convenient. In other words, the organization rules for assemblies does not necessarily correspond to the organization rules for types or IDs. The most common organizing principle is that you put related types in the same assembly. Commented Aug 11, 2015 at 19:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.