面向对象的内容系统 - 理念 [英] Object Oriented Content System - the idea

查看:47
本文介绍了面向对象的内容系统 - 理念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位大家好。


我正在用PHP5编写自己的内容系统。到目前为止,我已经编写了用于处理数据库连接,XML,XForms和Sessions的主要类别。


但我有一件事有问题 - 它与

实现甚至不相关 - 我正在寻找一个智能解决方案


我现在的系统是这样的:


/?module = main& page = intro


脚本包含并创建所有类实例 - 预处理基本

操作 - stats,privilages做更多的事情。

然后它包含''/main/intro.inc.php''文件,其中我使用了所有的

实例


但是当我只使用4个班级并且整个

系统是程序性的时候它不是和OO系统。


我正在考虑将模块''main''与class''main''和

page''intro''关联,方法''intro''。

将包含文件''main.inc.php''并创建新的ins tance

main将被创建 - main继承了

基类的一些属性和方法。


它将委托所有的主要的主要类例如。

$ main-> db-> select();

$ main-> xml-> addnode();


你如何找到我的解决方案?

也许你有一些提示,提示?


我会的感谢任何帮助


最好的问候

R

Hello everybody.

I''m writing my own Content System in PHP5. I''ve written so far main
classes for handling DB connections, XML, XForms and Sessions.

But I''ve got problem with one thing - it''s not even relative with
implementation - I''m looking for a smart solution

My present system works like this:

/?module=main&page=intro

script includes and creates all classes instances - preprocess basic
actions - stats, privilages do some more things.
then it includes the ''/main/intro.inc.php'' file where I use all the
instances

but It''s not and OO System when I use only 4 classes and a whole
system is procedural.

I was thinking about associating module ''main'' with class ''main'' and
page ''intro'' with its method ''intro''.
The file ''main.inc.php'' would be included and created new instance
main would be created - main inherits some properties and methods from
base class.

It would have delegate all the main classes to main eg.
$main->db->select();
$main->xml->addnode();

How do You find my solution?
Maybe You have some tips, hints?

I''d be thankful for any help

best regards
R

推荐答案

main- > db-> select();
main->db->select();


main-> xml-> addnode();


如何你找到了我的解决方案吗?

也许你有一些提示,提示?


我会感激任何帮助

最好的问候

R
main->xml->addnode();

How do You find my solution?
Maybe You have some tips, hints?

I''d be thankful for any help

best regards
R


R写道:
大家好。
<我正在用PHP5编写自己的内容系统。到目前为止,我已经编写了用于处理数据库连接,XML,XForms和Sessions的主要类。

但我有一件事有问题 - 它甚至不是相对的
实施 - 我正在寻找一个智能解决方案

我现在的系统是这样的:

/?module = main& page = intro

脚本包含并创建所有类实例 - 预处理基本动作 - 统计数据,特权执行更多功能。
然后它包含''/main/intro.inc.php''我使用所有
实例的文件

但当我只使用4个类并且整个
系统是程序性的时候它不是和OO系统。
<我正在考虑将模块''main''与class''main''和
page''intro''关联,方法''intro''。
文件''main .inc.php''将被包含并创建新实例
main将被创建 - main继承了一些属性和方法来自
基类。

它会将所有主要类别委托给主要的例如。
Hello everybody.

I''m writing my own Content System in PHP5. I''ve written so far main
classes for handling DB connections, XML, XForms and Sessions.

But I''ve got problem with one thing - it''s not even relative with
implementation - I''m looking for a smart solution

My present system works like this:

/?module=main&page=intro

script includes and creates all classes instances - preprocess basic
actions - stats, privilages do some more things.
then it includes the ''/main/intro.inc.php'' file where I use all the
instances

but It''s not and OO System when I use only 4 classes and a whole
system is procedural.

I was thinking about associating module ''main'' with class ''main'' and
page ''intro'' with its method ''intro''.
The file ''main.inc.php'' would be included and created new instance
main would be created - main inherits some properties and methods from
base class.

It would have delegate all the main classes to main eg.


这篇关于面向对象的内容系统 - 理念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆