Jump to content
xisto Community
Sign in to follow this  
k_nitin_r

Cakephp Database Conventions Guide to naming database table names and column names for CakePHP

Recommended Posts

Hi!When working with the CakePHP web development framework's object relational mapping layer, the framework follows a concept called convention over configuration.The tables that you define ought to be in plural (with an 's' at the end) and the column names should follow the following conventions:* The 'id' column is the primary key of the table* The 'name' column is the text that would be displayed to the user in place of the ID, which will be used internally* The 'tablename_id' column, where tablename is the name of any other table in singular form, represents a foreign key relationship with another tableThe convention over configuration approach has its advantages and disadvantages. The key advantages are that it speeds up the software development process and it helps easily determine the purpose of the various fields in the database table by simply looking up the names of the tables and the columns. The disadvantages are that the database conventions require the database administrators and database developers to familiarize themselves with the conventions and the conventions create a steeper learning curve for developers.

Share this post


Link to post
Share on other sites

thank you k_nithin_r for these useful information. even i don't use phpcake, but i heard that it has a lot of good features. and i know there are a lot of developers use it despite of its disadvantages. thank you for sharing.

Share this post


Link to post
Share on other sites

Hi!CakePHP is one of the most popular web development frameworks for PHP. It may or may not be the framework of choice for web development projects starting today because the approach followed by CakePHP has been improved upon and re-packaged into many different frameworks, including Symphony and CodeIgniter. CakePHP still is found in many existing web development projects and there's a lot of documentation and support available for it online.CakePHP follows the Model-View-Controller (MVC) architectural pattern for developing web applications. Although it takes a while to get used to at first, it is actually better organized than storing single PHP files within folders. The CakePHP framework provides helpers to do just about everything from rendering HTML forms to validating user input.@web_designerThank you for your kind words. I'll try to put together more information about CakePHP and will post it to the forum.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.