tags:

views:

267

answers:

2

Hi All,

I have split my .NET project into three different layers Facade Layer, Business Layer and Data Access Layer.

I am looking for the correct naming convention for the file names for these layers. For example if I have accounts related funtion in my project, I am currently having 'AccountsFAC.cs' and class name AccountsFAC in facade layer, AccountsBL.cs and class name AccountsBL in business layer, AccountsDAL.cs and AccountsDAL class name in DAL Layer.

I want to know whether this is the correct way of namign the files in different layers.

Added later

Suggestion #1

One of the suggestions given by Robert Koritnik below is to use descriptive names like 'AccountStore' and 'AccountService'

+1  A: 

I probably wouldn't include the layer abbreviations in the actual class names. I would divide the classes into appropriate libraries and namespaces, so that the namespace indicates the layer, not the class name.

These are terrible examples, you should choose more meaningful namespaces, but something more like this:

  • MyCompany.Whatever.Data.Accounts
  • MyCompany.Whatever.Business.Accounts
  • MyCompany.Whatever.Facade.Accounts
Andy White
Yes. But to remove disambiguation with same class names use names like AccountService for business process class, AccountStore for data layer and Account class for POCO class.
Robert Koritnik
Good point, using more descriptive words rather than layer abbreviations would be good. You should put that in as an answer, I'll vote it up!
Andy White
I feel using descriptive names like AccountStore makes more sense because as suggested by Robert, it removes the ambugity. One way to remove the ambugity would be to use namespace alias. thanks Robert
pradeeptp
A: 

An alternative would be to use different namespaces to separate your layers; e.g.

namespace Project.Accounts.Facade

namespace Project.Accounts.Business

namespace Project.Accounts.DataAccess

But I think the most important thing is consistency; as long as you use the same convention throughout your project, and that it is logical, then the convention that you use doesn't matter too much.

dylantblack