Home Comments

Project directory structure

stephanstephan Member Stephan StapelOrganization: Stephan StapelProject: BristolNG

Hi,

I have organized my projects to let the slice-compiled files live in a separate library which is probably best practice.
In my project, I have c# and c++ project, both in Visual Studio.
Do you have an advice on how to organize the project directory for such libraries, in particular for those Visual Studio projects?

Cheers,

Stephan

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    Hi Stephan,

    You can put your generated code (from Slice files) in a separate library or incorporate them in your C++ libraries/C# assemblies/programs. It all depends on what you do.

    For example, let's say you are writing a C# client and a C++ server, and nothing else. In this case, I would simply incorporate the C#-generated code in your client app and the C++-generated code in the server app - no need for a separate library.

    A separate library/assembly for the generated code is useful if you're sharing this code with multiple applications. If you look at Ice itself, we put the generated code for IceGrid, IceStorm and Glacier2 in separate libraries (in all language mappings); this way, many IceGrid/IceStorm/Glacier2 "clients" can reuse these libraries.

    These "generated code" libraries can contain other code as well. In particular in C#, you may want to take advantage of the partial class/interface feature that allows you to extend generated code, provided your extension is in the same assembly.

    Cheers,
    Bernard

Sign In or Register to comment.