Tech Off Post

Single Post Permalink

View Thread: Code re-use in Visual C# .NET Projects
  • User profile image
    TommyCarlier

    A good way to do it: split your functionality in multiple layered projects. At work, my solutions have these projects:
    - Common: common functionality, used everywhere (client, server, ...)
    - Client: client functionality, common for all applications we write
    - Server: server functionality, common for all applications we write
    - XClient (replace X with app.name): client functionality, specifically for 1 application
    - XServer (replace X with app.name): server functionality, specifically for 1 application

    So application A will have these DLLs: Common.dll, Client.dll, Server.dll, AClient.dll, AServer.dll
    And application B will have these DLLs: Common.dll, Client.dll, Server.dll, BClient.dll, BServer.dll

    Your generic form would be placed in the Client-project, so all your applications can use it (and subclass it to add functionality).