Home  >  Article  >  Backend Development  >  The latest php3 layer structure development technology_PHP tutorial

The latest php3 layer structure development technology_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:04:44684browse

P> As a popular web development language, php has been widely used for its simple writing and powerful features. However, at the same time, the application scope of the PHP language is limited to simple systems such as BBS, communities, and
voting stations. The reason for this situation is that PHP lacks a mechanism for developing large-scale application systems. Writing business logic code directly into the page is convenient during the development stage, but the result is that the maintainability and scalability of the entire system become extremely poor. We often encounter this situation. When users need to make a change to the system function, they will need to modify many related PHP programs.
Of course, if there is a good design, the situation will be better. Encapsulating the business
logic through functions or classes will improve the situation. However, the support for classes in PHP is limited. PHP only implements the encapsulation of properties and methods, and does not support some advanced object-oriented methods used in C++/Java. In general, the problems existing in PHP development are also the problems existing in the C/S structure, so the C/S structure gradually evolved into the current 3-layer structure or n-layer structure, and the concept of the middle layer was introduced .
The currently popular J2EE technology is such a three-layer structure application development model, with JSP as the front-end presentation layer, EJB as the intermediate business logic layer, and the database as the information layer. By isolating the presentation layer and the business logic
layer, the system has good scalability, maintainability and scalability. Therefore, J2EE technology is suitable for the development of enterprise-level application systems with changing needs and complex functions. PHP also needs such a structure,
to enable PHP to be applied to a wider field.
Now, we can use minij2ee application server to achieve this purpose. The minij2ee
application server is currently the only J2EE application server product that supports PHP. PHP uses the 3
layer development model based on minij2ee, which can encapsulate business logic in EJB and use PHP to quickly customize the front-end interface.
Taking the online store application system as an example (http://www.minij2ee.com/petstore/), EJB encapsulates
core business logic such as goods management, account management, order processing, etc., while PHP is used to customize the store The interface,
such as the display method of products, the style of the counter, etc. Since the core business logic is encapsulated in EJB, the front-end interface of the online
store can be customized according to customer needs without modifying the EJB program. In addition, due to the flexibility and scalability of
J2EE technology, even the expansion of business logic will become as convenient as plug&play
, just write a new EJB and integrate it into the original system.
For the field of software systems for small and medium-sized enterprises with a huge market, what is needed is not huge and expensive systems
, but software that is sufficient, practical and cost-effective. Using php+minij2ee coupled with an efficient and stable
Linux system and MySQL database is a good solution to this problem.






http://www.bkjia.com/PHPjc/445178.html

www.bkjia.com

true

http: //www.bkjia.com/PHPjc/445178.html

TechArticleP PHP, as a popular web development language, has been widely used for its simple writing and powerful features. application. However, at the same time, the application scope of php language is limited to some such as B...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn