+ -
当前位置:首页 → 问答吧 → Planning PHP Projects

Planning PHP Projects

时间:2006-08-02

来源:互联网

这个小短文不错,关于PHP项目的,看看谁有时间能翻译一下。
链接这里:
http://www.phpfreaks.com/tutorials/135/6.php

Planning PHP Projects

The biggest problem I see is most PHP scripts is a lack of structure and organization. What heralds this is a lack of planning. Many PHP programmers don't think through projects before they dive into the coding. This is a tutorial I wrote 3-4 months ago. I have learned a lot since then, especially concerning OOP techniques. I am currently working on a new version, however, I considered it complete enough to be posted here. Please comment so that the next revision of it will improve!

Planning?

When coding a large, or even moderate or small size, project the most important thing is planning. When you get to the level in which you will, without a tutorial or book, be programming something on your own you know you can do the coding. You know you can connect to databases, print things to the screen, create basic classes, etc. However, what many people do when they reach this stage is skip the planning process and dive right into the coding procedure.

While improvisation during programming is good, if you want a streamlined application that shows consisten programming practices, is easy to update, and is simple to code, the best tool is a plan. If you have a database structure, if you have outlined the structure of your code, if you know exactly what you want your application to do, programming is a breeze. Succesful planning is not treated in most books or tutorials, because in the books and tutorials the author does the planning for you. But once you are creating an application on your own, you must plan and look ahead.
Hopefully, this tutorial will help you understand how to plan an application. It will be, eventually, a two or three part series that will address planning features, planning classes, database structure, templating, message abstraction, and hopefully some basic coding technique. It is not intended to teach you how to code PHP, instead it is intended to show you how to structure and plan your code well.

Enjoy! I have utilized these practices while creating programs, and when it comes to adding features and creating new versions, planning and good code structure is the most important part of the process.

Table of Contents
As a preliminary to the tutorial, I will show you here what I intend to cover:
•        Planning Features
o        What will your application do?
o        How are these features related?
o        What scripts will handle this?
•        Database
o        What kind of database?
o        How will the database work?
o        What will be in the database, what in config files?
•        Planning Code Structure
o        What classes will the application use?
o        What will these classes do?
o        How will they be structured?
o        How will the application communicate with the classes?
o        What will be in the classes, and what in the actual code?
This isn't all that will be covered, but it is a guideline to what will be discussed in the course of the tutorial.

请下载,或者看看链接。

作者: Per   发布时间: 2006-08-02

支持,国外这方面的确比国内强~~

作者: dashan   发布时间: 2006-08-02

php项目的规划
我所见最大的问题是绝大多数的php脚本缺少体系结构和规范化的组织。而这些则预示着缺乏规划。许多的php开发者在开始投入编码前没有考虑整个项目。这是我在三四个月前写的一个补习内容。从那时候起我学到了很多东西,特别是oop技术,当前我正就新的版本继续工作,不过,我认为这完全足以帖到这里。请评论,以便未来的版本可以得到更好的改进。
规划
不管是在代码量庞大,还是规模尚小的时候,对于一个项目最重要的都是规划。当你作到了这种程度的时候,不用温习或者书本,就能够编写一些你自己的代码。你知道你能够编码,你知道你能够连接数据库
、打印一些东西到显示器、创建基本的类等等。但是,当他们达到这个阶段的时候,许多人会跳过规划这个步骤而转入到程序编码之中。
显然在编码过程中的即兴创作是非常好的,如果你想简化应用程序以表明consisten节目的做法,是很容易升级而且也使代码更简单,那么最好的工具就是规划。如果你有一个数据库结构,如果你有代码结构,如果你清楚的知道你需要你的应用实现什么,那么项目是使人凉爽的。成功的规划在大部分的书籍和辅导中没有被认真的对待,因为在这些书和辅导之中,作者没有针对你的这个计划。但是一旦你正在创建一个你自己的应用程序的时候,你必须规划并且向前看。但愿这次补习能够帮助你理解如何去规划一个程序。这将最终是两三个系列的的一部分,将讨论规划的特点、规划类、数据库结构、样本,提取信息,期望的一些基本的编码技术。他不是要来教你如何PHP编码,而是要告诉你如何组织和规划好你的代码。
享受这些乐趣!我已经利用这些做法创建了项目,并且正要添加一些功能和开发新的版本,而规划和好的代码结构是最重要的部分!
内容列表:
作为一个初步的补习,我打算在这里包括:
* 规划的特点
* 你的应用将要做些什么
* 这些特点之间的关系
* 什么样脚本来处理这些
* 数据库
* 数据库的类型
* 数据库是如何工作的
* 数据库中的内容是什么,配置文件中的内容是什么
* 规划的代码结构
* 应用将用到那些类
* 这些类是如何做的
* 他们是如何结构化的
* 应用是如何与类进行通讯的
* 类的内容是什么,真实的代码中有什么内容
这些并不是所有要被函盖的,但是这些是一个来指出在这个补习的课程中将要讨论到的内容的向导。

[ 本帖最后由 名下 于 2006-8-4 14:02 编辑 ]

作者: 名下   发布时间: 2006-08-04