c# - Is this the good pratice to name the namespace according to the directory name -
i have directory structure store source files. practice name naming space according directory structure?
like
models\model.cs data\data.cs
one defined in namespace models 1 defined in namespace data
yes, that's typical approach, , it's 1 that's supported tools such resharper.
the difference between , java approach don't add directories way down top - default namespace project. example, suppose creating foo.bar.baz.model , foo.bar.baz.data, c# , java solutions might be:
c#:
foo.bar.baz foo.bar.baz.csproj defining project default namespace of foo.bar.baz model\ somemodel.cs data\ somedata.cs
java:
src\ foo\ bar\ baz\ model\ somemodel.java data\ somedata.java
Comments
Post a Comment