index > .NET Framework Data Access and Storage > Repeating name in namespace + classname, because I named dataset+...

Repeating name in namespace + classname, because I named dataset+...

That topic title is a bit vague, let me explain:

I am setting up a solution, it's for a system, let's call it 'CoolThing'. The solution is called CoolThing, it contains a Class Library called CoolThing.DAL and another one called CoolThing.BLL. The default namespace for those projects is the same as their name.

Now I have created a database in SQL Server, called 'CoolThing'. So I add a DataSet to the DAL project, and I'd like to call it 'CoolThing', since that seems logical.

Here's the full classname for a DataTable:
CoolThing.DAL.CoolThing.DataTable
Michiel1978

You should look up some resources on 'naming conventions'.

If you really want to give them all the same name, add a prefix that identifies them such as:

clsCoolThing - for a class
dsCoolThing - for a DataSet
dbCoolThing - for a Database
dtCoolThing - for a DataTable

Same thing goes for your variables:

strMyString - for a string type
intMyNumber - for an integer type
blnMyFlag - for a boolean flag

And so on...

It makes your code easier to read, debug and maintain. It also makes it much easier for other developers to do the same.

Steve

Stephen McGuire
Hey, I really appreciate your reply, but as I understand it, your suggestions are definitively not the current suggested naming conventions. Prefixes were recommended before .NET, but the recommendation was to use them not to indicate type, but usage (see Hungarian notation). But with .NET came new recommendations.

I have a book called Framework Design Guidelines. It's full of useful advice, but not on my problem here.
Michiel1978
reply 3

You can use google to search for other answers

 

More Articles

• DataView, CType's Expression & Sqlexpress'Database: How to de...
• table adapters - update
• interacting applications
• Dynamic connection strings.. possible?
• Sample Code
• how to open excel file (on server), write some value to it and sa...
• Performance question with DataReader
• Informix Problem
• Error when saving a "Computed" table column.
• SQLPrepare(): Debug vs Release
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Where to download interop.mapi.dll?
• Please Help ME!!! Web Service about Clie
• OracleClient don't connect, OleDB with s
• Informix Problem
• Problem inserting sql query into databas
• Performance question with DataReader
• Adding shortcut key to TabControl
• [C# 2.0] ControlState
• Dynamically remove textbox
• How To Store Products with Attributes
• How to get Database information in ASP.NET
• stored procedure Parameter information
• Add new Record in VB 2005
• Calculated Column --> Using Custom Ag
• Where to store SQL server connection str

Hot Articles

• Which Method is Better for Transferring
• Table Adapter, set foreign key fields on
• Access to SQL Database via TCP/IP
• Executing Oracle function using ADO.Net
• How to import data from another database
• How can i use SqlTransaction with TableA
• retrieve schema info for a SQL statement
• Null Value exception thrown, need to cha
• No value given for one or more required
• Dynamically remove textbox
• Framework Versions
• Oracle Connectivity Problem
• Where to store SQL server connection str
• Issues with updating Access DataSource
• Retrieving @@Identity from Access databa

Recommend Articles

• How to get the max length of text field
• Com Exception is unhandeled while execut
• Problem | Oracle 9i Release + With Vb.Ne
• SQLDataReader.GetOrdinal() fails rarely
• Do DataTables need locks?
• Too many connections to database
• Update without Parameter
• HELP!! writing sql in vb.net (ado.net)
• Save DataTable to new Databasefile
• Access to path to the database was denied
• Unable to cast object of type 'System.Ob
• suggestion for data manipulation code op
• SQL Server 2005 JDBC Driver and x64 sys
• Problem with calculated column - does no
• Active Directory+Database