I am looking to see if this could come back to bite me in ways I did not anticipate. Right now I have 3 classes (example classes), which live in the same namespace.
SqlServer.SqlServerConnectionSettings
SqlServer.SqlServerCredentials
SqlServer.SqlServerInstance
Later down the line I would also plan to have others like below.
SqlLite.SqlLiteConnectionSettings
SqlLite.SqlLiteCredentials
SqlLite.SqlLiteInstance
I’m starting to think it would be easier to
SqlServer.ConnectionSettings
SqlServer.Credentials
SqlServer.ServerInstance
Where collisions are handled only when ambiguous, by appending the namespace like above.
My only concern is that most code I see is prepended like my first example. Is there anyone that has gone and removed the prepended text from their codebases and found it improved or degraded readability?
I’ve been using the method you’re suggesting for a while now and prefer it to the prepended style you’re referring to. I think it makes the code cleaner easier to read and have not run into any collisions in our projects. I also think it’s important to make your namespace very descriptive without being superfluous…DataAccess.Database.SqlServer.ConnectionSettings.