473,378 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Naming data access components

Hi,

What are people's thoughts on naming convention for data access
components?

I'm building two classes that will be used by an ObjectDataSource for
data binding:
1. Data entity (encapsulates a single record, e.g. Employee)
2. Utility class (performs employee ADO.NET database operations)

I'm fairly settled on "Employee", but can't decide what to call the
utility class?

- EmployeeDB
- EmployeeFactory
- EmployeeUtility
- EmployeeData
- Employees

Any thoughts?

Chris

Apr 12 '06 #1
6 1856
It really doesnt matter,

I always use something like:

EmployeeDAL (Data Access Layer) or EmployeeDA (Data Access) and
sometimes I use EmployeeDBA (Employee Database Access)

just a matter of preference

Apr 12 '06 #2
Chris,

I think that whatever naming convention you decide on, using it consistently
is the key.

I always name database tables with a plural name. So, for example, I would
name a table that contains employee data Employees.

Then I always name my data access classes with the name of the table they
are providing access to, along with the suffix "DA". So the data access class
for the Employees table would be EmployeesDA.

I always name a business class that works with an individual entity with the
singular version of the name of the table where the entity is stored. So
Employee is the name I would give to a business class that works with an
employee from the Employees table.

Kerry Moorman
"Chris Fulstow" wrote:
Hi,

What are people's thoughts on naming convention for data access
components?

I'm building two classes that will be used by an ObjectDataSource for
data binding:
1. Data entity (encapsulates a single record, e.g. Employee)
2. Utility class (performs employee ADO.NET database operations)

I'm fairly settled on "Employee", but can't decide what to call the
utility class?

- EmployeeDB
- EmployeeFactory
- EmployeeUtility
- EmployeeData
- Employees

Any thoughts?

Chris

Apr 12 '06 #3
Thanks Kerry, I'd agree with all that. I like the "DA" suffix, I've
also seen "DAL" (data access layer) somewhere else since I originally
posted.

On a related note, if you're using stored procedures to select, insert,
update and delete your entities, do you having any naming conventions
for those?

Chris

Apr 13 '06 #4
Chris,

I don't use stored procedures for create, read, update, delete (CRUD)
operations, so I have not developed a naming convention for those kinds of
stored procedures.

I have a home-grown code generator that generates a business class and
associated data access class for an entity table. My data access class
contains methods that use SQL with parameters for the CRUD operations.

Kerry Moorman
"Chris Fulstow" wrote:
Thanks Kerry, I'd agree with all that. I like the "DA" suffix, I've
also seen "DAL" (data access layer) somewhere else since I originally
posted.

On a related note, if you're using stored procedures to select, insert,
update and delete your entities, do you having any naming conventions
for those?

Chris

Apr 13 '06 #5
Kerry,

Thanks for your feedback. I've been using parameterised SQL queries so
far, but anticipated using stored-procedures in future. However, I'm
not sure if there'll be much of an advantage, and it might just add
another layer of complexity to my application.

I like the idea of using an automated code-generator, I might have to
look into something similar. I'm already loving Visual Studio's
"Encapsulate Field" refactoring feature when building entity classes.

Chris

Apr 13 '06 #6
I personally try to use Stored Procedures whenever possible, This way
my SQL queries are not in my code, but on the database.

Up to this point I used SP's, but recently I started using O/R Mappers
for CRUD operations which seperates the BO's from the CRUD operations
(which is much better) and as a result like the other guy said, it
generates the CRUD logic for me.

Apr 14 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tony Lee | last post by:
Some time a ago, on this newsgroup the following comments were made in recommending good references for Access (2003) >I used to recommend Dr. Rick Dobson's, "Programming Access <version>" for...
8
by: Jason | last post by:
In my ASP.NET 1.1 solutions, I created several web projects and compiled them each into an assembly. The assembly names reflected the functionality of the feature (Membership.dll, Dues.dll, etc)....
3
by: Nathan Sokalski | last post by:
I have written a custom control that uses AJAX (it implements IPostBackDataHandler and ICallbackEventHandler). I have tested it, and it seems to work the way I want. However, when I used it in...
3
by: Nathan Sokalski | last post by:
I have written a custom control that uses AJAX (it implements IPostBackDataHandler and ICallbackEventHandler). I have tested it, and it seems to work the way I want. However, when I used it in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.