Sharing without seeing the code, possible?
-
This is not a coding question, but related to Visual C++. Here is the situation. I am planning to employ several programmers to help me coding. Is there any way to let them add new classes/dialogs/resources without seeing the implementation of my existing classes/dialogs/resources? Of course I want them to be able to use my classes (the main/base classes), but I don't want them to have the whole code (which I wrote for several years) for security and other reasons. I would appreciate any suggestions or ideas. Thanks.
-
This is not a coding question, but related to Visual C++. Here is the situation. I am planning to employ several programmers to help me coding. Is there any way to let them add new classes/dialogs/resources without seeing the implementation of my existing classes/dialogs/resources? Of course I want them to be able to use my classes (the main/base classes), but I don't want them to have the whole code (which I wrote for several years) for security and other reasons. I would appreciate any suggestions or ideas. Thanks.
If you have interfaces (pure virtual classes which do define neither member variables nor any implementation or classes which map their interface on your implementation-classes in your code, you can give them only that. But as you ask here you probably have neither. Maybe you can get away with giving them a "cleaned up" version of the headers, with any variable declaration and private function removed as an interface. That way, they could include your code as a closed-source-lib. Or these guys set up their own set of mock-objects using your interface?
Failure is not an option - it's built right in.
-
If you have interfaces (pure virtual classes which do define neither member variables nor any implementation or classes which map their interface on your implementation-classes in your code, you can give them only that. But as you ask here you probably have neither. Maybe you can get away with giving them a "cleaned up" version of the headers, with any variable declaration and private function removed as an interface. That way, they could include your code as a closed-source-lib. Or these guys set up their own set of mock-objects using your interface?
Failure is not an option - it's built right in.
I don't quite get "cleaned up" header approach. Don't I still need to give them the .cpp files so that they can compile the whole project? I never created a .lib before (but used many). Is there really a way to give them just the .h files without the .cpp, just like a .lib does? This is really what I am going for: they can see the header, but not the implementation. P.S.: in the "cleaned up" approach, I simply move the variable declaration and private functions to .cpp file? Thanks for any help.
-
I don't quite get "cleaned up" header approach. Don't I still need to give them the .cpp files so that they can compile the whole project? I never created a .lib before (but used many). Is there really a way to give them just the .h files without the .cpp, just like a .lib does? This is really what I am going for: they can see the header, but not the implementation. P.S.: in the "cleaned up" approach, I simply move the variable declaration and private functions to .cpp file? Thanks for any help.
All my musing about possibilities was nothing for the short-term. But with a (more or less) limited amount of work, you probably could form your code into a library. The interface of that library needs to be a working c++ header file with all variables and private members. Maybe that is OK with you. If you think your contarctors would get too much information from seeing the variable types you defined, you need to go one step further. Add an Interface-header, which declares a abstract base class. You (or them) would then have to implement a "mockup-implementation" of this interface. This may be (probably is) a large amount of work. That way, they could program against the interface, with only you putting the code together. In the "cleaned" approach, as many private functions as possible are moved out of the class to an anonymous namespace at the top of the cpp-file. As your contractors never get to see the content of the cpp-file, you are hiding this code from them. Functions in an anonymous namespace are effectivly static members, and from my experience, an astounding amount of non-trivial static functions could be made static.
Failure is not an option - it's built right in.
-
All my musing about possibilities was nothing for the short-term. But with a (more or less) limited amount of work, you probably could form your code into a library. The interface of that library needs to be a working c++ header file with all variables and private members. Maybe that is OK with you. If you think your contarctors would get too much information from seeing the variable types you defined, you need to go one step further. Add an Interface-header, which declares a abstract base class. You (or them) would then have to implement a "mockup-implementation" of this interface. This may be (probably is) a large amount of work. That way, they could program against the interface, with only you putting the code together. In the "cleaned" approach, as many private functions as possible are moved out of the class to an anonymous namespace at the top of the cpp-file. As your contractors never get to see the content of the cpp-file, you are hiding this code from them. Functions in an anonymous namespace are effectivly static members, and from my experience, an astounding amount of non-trivial static functions could be made static.
Failure is not an option - it's built right in.
Yup, i think that's the best solution here: to change my code into a library. Although this only "hides" the code that doesn't deal with dialogs/resources, correct? Thanks a lot.
-
Yup, i think that's the best solution here: to change my code into a library. Although this only "hides" the code that doesn't deal with dialogs/resources, correct? Thanks a lot.
You can have a lib that is opening dialogs. But then the project using the lib has to include the libs rc-file: In the Studio resource-view, right-click on the "PROJECTNAME.rc" and select "resource include" to enter the line
#include "lib-resource-file.h
in the upper and#include "lib-resource-file.rc"
in the lower box. Most often, the rc-files do not contain anything special.
Failure is not an option - it's built right in.
-
You can have a lib that is opening dialogs. But then the project using the lib has to include the libs rc-file: In the Studio resource-view, right-click on the "PROJECTNAME.rc" and select "resource include" to enter the line
#include "lib-resource-file.h
in the upper and#include "lib-resource-file.rc"
in the lower box. Most often, the rc-files do not contain anything special.
Failure is not an option - it's built right in.
Cool, a perfect solution then. Thanks a lot.
-
I don't quite get "cleaned up" header approach. Don't I still need to give them the .cpp files so that they can compile the whole project? I never created a .lib before (but used many). Is there really a way to give them just the .h files without the .cpp, just like a .lib does? This is really what I am going for: they can see the header, but not the implementation. P.S.: in the "cleaned up" approach, I simply move the variable declaration and private functions to .cpp file? Thanks for any help.
Joe Smith IX wrote:
Is there really a way to give them just the .h files without the .cpp, just like a .lib does?
Yes.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Cool, a perfect solution then. Thanks a lot.
This can be helpful when using Visual Studio to manage multiple resource files: TN035: Using Multiple Resource Files and Header Files with Visual C++[^] Especially the part about resource IDs :) Mark
Mark Salsbery Microsoft MVP - Visual C++ "Great job team! Head back to base for debriefing and cocktails."
-
This is not a coding question, but related to Visual C++. Here is the situation. I am planning to employ several programmers to help me coding. Is there any way to let them add new classes/dialogs/resources without seeing the implementation of my existing classes/dialogs/resources? Of course I want them to be able to use my classes (the main/base classes), but I don't want them to have the whole code (which I wrote for several years) for security and other reasons. I would appreciate any suggestions or ideas. Thanks.
Compile your code into a DLL and export the classes. They'll see the method prototypes, but won't see the code behind them. One thing to consider is that you MUST provided complete documentation for the classes so the programmers know how to use them properly.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001