views:

116

answers:

2

I have a DataType (text, numeric, date, boolean, money) enum and I need to put that in a file. How should I call the file and where in my DataAccessLayer.Generic namespace should I put the file into? Right now the file is called enum.vb and is in the DataAccessLayer.Generic.DataTypes namespace. The Result is DataAccessLayer.Generic.DataTypes.DataType, but it is misleading because the file is called enum.vb

Thanks

+1  A: 

I would call the file DataType.vb since that is the name of the type within the file.

Without knowing more about your application's architecture it would be difficult to give namespace advice but this should be fine:

DataAccessLayer.Generic.DataTypes.DataType

Especially if the DataAccessLayer.Generic.DataTypes namespace contains other types and the enumeration in question belongs with them.

Andrew Hare
Yep, some of my files have few characters (delegate declarations for example), but by following these names you sure can find things. :)
280Z28
Yes, DataTypes contains TextDataType, NumericDataType, BooleanDataType, DateDataType... Each on implements a IDataTypeDecorator that has a ReadOnly Property DataType as DataType
Marco Bettiolo
A: 

I have put Enums into a file which I call 'Common', meaning it is shared among the entire namespace. I know that breaks 1 item per file rule, to me Enums are an exception to that rule.

David Basarab
All of the types are common to the namespace. By that rule, you could get away with 1 file per namespace.
280Z28
Just Enums. So I have a namespace of Foo.Bar.Data in the data folder there would be a commmon file that contains the Enums for everything in Foo.Bar.Data. An object called GenericAccessObj has its own file.
David Basarab