AntonioEspinosa / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

Protection level should be parameterized #139

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Generate a .proto file;
2. All types and methods are always public (or protected).

What is the expected output? What do you see instead?
It should be possible to change the protection level through an option or 
parameter.

What version of the product are you using? On what operating system?
1.0.0.280

Please provide any additional information below.
I have already found the option to copy the XSLT files and change the code 
generation there. This really helps a lot. It would still be very nice though 
to be able to use the installed XSLT files and provide the protection level 
through a parameter.

Original issue reported on code.google.com by pvginkel on 5 Nov 2010 at 8:44

GoogleCodeExporter commented 9 years ago
Making the *types* internal would be an option (via a switch), but this would 
adversely affect some of the frameworks where reflection is more restricted. 
Member-level would require more work, as this would presumably require .proto 
extension, which is a bit... problematic.

Original comment by marc.gravell on 7 Nov 2010 at 9:41

GoogleCodeExporter commented 9 years ago
If the types themselves could be made internal, this would be enough. The 
reason I requested this is that I see the protobuf classes as implementation 
details to my protocol. Yes, I use these as anemic classes just for data 
transfer. The classes that that are actually used to work with the requests 
from the outside world have a very different layout and implementation which 
don't match with the protobuf classes. Hiding the protobuf classes helps 
keeping my API clean.

Original comment by pvginkel on 7 Nov 2010 at 9:44

GoogleCodeExporter commented 9 years ago
That should be possible (including command-line support) purely from the xslt; 
I'll see what I can do.

Original comment by marc.gravell on 7 Nov 2010 at 10:26