tags:

views:

76

answers:

4

Note: application, as opposed to libraries.

I've got a WPF application. It's broken down into a main application project and associated class libraries.

Are there any circumstances where any of the classes in the main application need to be public, as opposed to internal? For example, do data bindings or WPF value converters need to be public, if the XAML is in the same assembly?

+2  A: 

If you don't plan on any of the classes interacting outside of the application executable, you should be fine.

Obviously, this would be different if your app started using different assemblies to segregate the code.

Kevin
+2  A: 

Unless you are planning on referencing your EXE from another application, there is no reason your classes can not exclusively be internal.

davisoa
A: 

No.

I dont know what else to say. :)

leppie
When you have over 20k in rep, it doesn't matter how much you get down-voted! :)
kirk.burleson
+1  A: 

Absolutely.

You should use the Principle of Least Privilege to govern how your classes interact. If they don't need to be visible outside the immediate assembly, use internal. If they will only ever be used by one other class, make them a private nested class. And so on.

Jesse C. Slicer