网站的组织和使用面向对象的编程 [英] organization of site and use of object oriented programming

查看:55
本文介绍了网站的组织和使用面向对象的编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用php,并且在我的网站的Organizatoin中遇到问题.
我无法正常使用我的功能.
这个问题非常关键.
我认为,如果使用面向对象的编程=>解决我的问题

I work php and I have problem in organizatoin of my site.
I can not to regular my functions.
this problem is very critically.
I think if use of object oriented programming =>solve my problem

推荐答案

我认为您使用Google翻译用英语问了您一个问题,不是吗? :)无论如何,从我从您的问题中可以理解的范围来看,您在以模块化方式管理和组织网站以及将逻辑与表示层分离方面遇到了麻烦.

好吧,说实话,PHP并不是真正意义上的面向对象(我也可能错了).它是一种解释性语言,因此随着代码的增长,它确实会变得有点像意大利面条.

但是,将UI,业务和数据逻辑划分为类并在GUI中引用它们始终是一个好主意.尽管这实际上取决于您的网络应用程序的结构有多复杂.我绝对会赞成面向对象和分层的开发风格,这绝对值得一试.使网站的组织和管理变得更加容易,尤其是在将更改推送到网站时,您可以在其中将更改本地化为特定文件,而不是更新凌乱且and肿的单个文件应用程序.

希望这在一定程度上有所帮助.干杯.
I think you used Google translate to ask your question in English, didn''t you? :) anyway, from what i can understand from your question you are having trouble managing and organising your website in a modular way and separating logic from the presentation layer.

Well, to be honest PHP is not Object Oriented in true sense (i might be wrong as well). Its an interpreted language so it does tend to become a little spaghetti like after a while as the code grows.

However, separating your UI and business and data logic into classes and referencing them in your GUI is always a good idea. Although it really depends how complex is the structure of your web-app. I would definitely rule in the favour of Object Oriented and layered style of development, its definitely worth a shot. Makes it easier to organise the site and hence manage it especially when pushing changes to the website where you can localise the change to a specific file rather than updating a messy and bloated single file apps.

Hope this helps to some extent. Cheers.


这篇关于网站的组织和使用面向对象的编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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