HOME       >>       Programming

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


k_nitin_r

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.


web_designer

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.


k_nitin_r

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.



VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.