Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 11th, 2011, 06:45 PM
Authorized User
Points: 192, Level: 3
Points: 192, Level: 3 Points: 192, Level: 3 Points: 192, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2006
Location: God's country , United Kingdom.
Posts: 41
Thanks: 1
Thanked 0 Times in 0 Posts
Default Best practice/naming convention asp.net app

Hi all,
I'll be starting a greenfield ASP.NET project in a few weeks (lucky me) and want to get the project off to a good start by putting some solid foundations / best practices down at a very early stage.

I'm doing some R&D around what's best practice around structuring the solution and naming conventions. Obviously it will depend on the domain, but I'm thinking 3 layer architecture and using namespaces instead of postfixing classes and project names with BLL/DAL, etc.

And this is where I'm struggling - coming up with the namespaces and abstracting the folder naming and getting mindset of not using DAL and BLL. So I'm thinking of the following going forward:

Solution name:
CompanyName.ProjectName

The data access layer (class library):
CompanyName.ProjectName.DataAccess

The business logic layer (class library)
CompanyName.ProjectName.BusinessLogic

Presentation Layer (web application)
CompanyName.ProjectName.Web

So far, so good I think? What I'm struggling with now though, is then grouping the code in the DataAccess layer and BusinessLogic layer. The web project will take care of itself as I've done those many many times.

If I was using a "Customer" and "Orders" as an example, should my folder structure/naming be like the following:

DataAcess:

Accessors (root folder name)
Customer (sub folder name)
CustomerAccessor.cs
Order (sub folder name)
OrderAccessor.cs


Business Logic:

Managers (root folder name)
Customer (sub folder name)
CustomerManager.cs
Order (sub folder name)
OrderManager.cs

Is this a good idea postfixing classes with Manager in the BLL and Accessor in the DAL? Or do any of you have any better naming conventions or folder structures to use?

Obviously I've done alot of reading around this and the above is the best I can come up with. But, any help or real world examples would be greatly appreciated in pointing me in the right direction.

It looks like a very subjective area but I'd like to get off to a good start which will obviously help long term in extending the project and making the code readable and managable
Cheers,
Elwappo
Reply With Quote
  #2 (permalink)  
Old August 12th, 2011, 04:21 PM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,044
Thanks: 80
Thanked 1,580 Times in 1,557 Posts
Default

Hi there,

Most of this makes a lot of sense. Personally, I wouldn't create that many folders if they only contain a few classes. You might as well store your OrderManager and the CustomerManager in the same folder. I typically divide them by type, rather than by what they represent (e.g. Interfaces, Collections, BaseTypes) and then have a Main folder for smaller projects, or various sub section related folders (e.g. your Customers and Orders folders if each of them contain a large number of files).

Cheers,
Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old August 12th, 2011, 05:24 PM
Authorized User
Points: 192, Level: 3
Points: 192, Level: 3 Points: 192, Level: 3 Points: 192, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2006
Location: God's country , United Kingdom.
Posts: 41
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Hi there,

Most of this makes a lot of sense. Personally, I wouldn't create that many folders if they only contain a few classes. You might as well store your OrderManager and the CustomerManager in the same folder. I typically divide them by type, rather than by what they represent (e.g. Interfaces, Collections, BaseTypes) and then have a Main folder for smaller projects, or various sub section related folders (e.g. your Customers and Orders folders if each of them contain a large number of files).

Cheers,
Imar
Thanks Imar,
And I think you're right about the folder structure - probably a bit too much. I think I'm gonna stick with "Mangers" and "Accessors" and then just group the classes under those. And then group other types under their respective folders as you suggest.

I've also had a thought that I could potentially end up with clashes if I've got a got a folder named the same as a class, so I'm going to keep it simple and readable.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about interface naming convention notig BOOK: Beginning Visual C# 2010 1 October 1st, 2010 09:21 AM
SQL Server Naming convention for Replication darrenb SQL Server 2005 3 May 3rd, 2008 03:50 PM
Table path using 4 part naming convention snufse SQL Server 2000 1 February 1st, 2008 07:45 PM
host has preset database naming convention crmpicco PHP Databases 0 October 23rd, 2007 02:14 PM
post xml data from ASP.NET app to ASP app polekat Classic ASP Professional 2 January 31st, 2007 08:44 AM



All times are GMT -4. The time now is 12:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.