Agile & TDD, Java, Python, PHP, Open Source, ...and Sailing
Database Table and Entity Bean Naming Conventions

As I'm creating this blog, I decided to do some refactoring of my PHP code. I'm beginning to take a more Object-Oriented approach to PHP as opposed to treating it as a scripting language. With my extensive Java background (and currently reading EJB 3 & JPA), I have a natural tendency to create "beans" for my class names.

I've never been lucky enough to be in charge of both the database creation as well as the "bean" creation on the same project...until now.

I've always been a fan of using the plural form for table names e.g. ENTRIES, COMMENTS, RATINGS, etc. But for beans, I prefer a singleton naming convention such as Entry, Comment, Rating, etc. This seems to create some confusion, especially when the plural is of irregular form.

So I'm stuck debating with myself, with which one of the four possibilities do I conform? Which convention(s) do I break? For now, I'll stick to my guns and break the non-convention of Entity-to-Table likeness.

What are your naming conventions, and why?


0 Comments

Post a Comment
Your comment has been sucessfully added.
Sorry, an unexpected error occured. Please try again later.





CAPTCHA

portrait

Matthew Boston is a software developer and freelance web developer located in Columbus, OH.

Currently, Matthew is working on an enterprise test harness utilizing Python, Java, XML, WSDL, Maven, and Hudson CI.

Also, Matthew is developing a Dropbox-like application that expands upon the idea of a network-shared drive.

More about Matthew.

my LinkedIn profile
Search
Coming Soon
Tag filtering
Comments for readers
Reader-driven ratings for blog entries
Site-wide searching
Tag cloud
RSS feed
Reply-to comments