views:

235

answers:

5
+2  Q: 

Project Naming

As a beginner/intermediate developer one problem I run into as my projects get bigger and more abstracted away as i use more OOP principles I have a problem with naming things. Like when i have multiple projects or class libraries I don't know what to name them. I see things from xxx.Core to xxx.Main or have even seen xxx.BLL and xxx.DAL. While looking through others i have seen xxx.Services and xxx.Data for their library and namespaces.

Then once that is solved is what do i cal DTO's? In that realm i have seen xxx.DTO, xxx.Entities, xxx.Props.

What are some good guidelines to naming libraries, methods, interfaces, etc... while coding so that more and more people will understand things when they come to pick up the project after me.

+3  A: 

There really is no standard for naming components of a project. The important thing is to pick a convention that works for your project and then apply it consistently.

ElectricDialect
+6  A: 

Abbreviations are in general bad.

Data Access Layer
YourCompany.Data.dll

Entity Layer
YourCompany.Data.Entities.dll

Business Layer
YourCompany.BusinessLogic.Name.dll (example: YourCompany.Accounting.Services.dll)

This isn't gold either, I am sure there are a lot other types of ways you can do this, we do this so it is much easier to find project, assemblies, and build the proper deployments. Plus when looking through your assemblies, seeing full names, rather than "MS.BLL.dll" is a lot more friendly.

Tom Anderson
A: 

You might get some ideas on structuring packages here: http://stackoverflow.com/questions/210567/package-structure-for-a-java-project

As for methods, interfaces, variables, etc....give everything a name that describes exactly what it does or represents. There are different standard naming conventions for every language. You might want to google the language you're programming in.

Lisa
A: 

Agreed with Tom Anderson that you need to not be afraid of doing some typing. Trying to make everything as short as possible is more of a roadblock to nomenclature than people realize, and nomenclature is more of a roadblock to development than people realize.

chaos
A: 

Hey %20, fancy seeing you here :) (assuming you are the one from 3dbuzz)

Anyhow, use namespaces and folders! Don't go crazy with DLLs if you don't need to. For the kind of applications I am assuming you are talking about DLLs will probably be overkill. In C# use folders and namespaces. For example:

Library
 - Net code
 - DBA code
 - Controller manager code
 - Factories
Application
 - Forms
 - Controllers
 - Models
  - Helpers

In C++, I usually:

Library
 - Net Code
  - Header Files
  - Source Files
  - Inline/template files
 - DBA Code
  - Header Files
  - Source Files
  - Inline/template files
Application
 -Model
  - Header Files
... and so on

In PHP it's harder without namspaces. But I still follow the same folder structure as in C# but I name my classes to make up for no namespaces. For example, if in C# I had a class called "Index" under the Application.Controllers.Course namespace, in PHP I would call it:

Application_Controllers_Course_Index

Anyway, please don't go DLL crazy without a good need for it. I cant stand seeing applications with over 5 DLLs that are never used elsewhere besides in the main EXE.

nlaq
Yeah same person. Yeah I understand that I was more after the actual naming itself not necessarily organization.
percent20