PHP

Application of lightweight MVC-like structure in PHP

INTRODUCTION Object-oriented programming (OOP) is a programming paradigm that uses “objects” – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, modularity, polymorphism, and inheritance. Many modern programming languages now support OOP. Since the proposed of the method that OOP models realworld objects with software counterparts, the outstanding advantages of OOP in aspects like programming and software engineering cause the increasing numbers of organizations using it to implement their applications and applying it into the improvement of various types of programming languages. However, as one of the most widely used web script syntax present, since the creation in 1994, PHP went through the transformation from the uncomplicated version as Personal Home Page Tools to the recent unique grammar that mixed C, Java, Perl and PHP’s own innovative grammar. For the purpose of meeting the programming method’s progress, the later version since PHP 4.0 had added the features of OOP. But when compared with its outstanding performance in small web sites, lightweight application, the front of large sites, the OOP feature seemed like to be inferior slightly. MVC, which was described in 1979, by Trygve Reenskaug, then working on Smalltalk at Xerox PARC, is not a totally new concept. In the design of web applications, MVC is implemented by web template systems as a “View for web” component. MVC is often seen in web applications where the view is the HTML or XHTML generated by the app. The controller receives GET or POST input and decides what to do with it, handing over to domain objects (i.e. the model) which contain the business rules and know how to carry out specific tasks such as processing a new subscription, and which hand control to (X)HTMLgenerating components such as templating engines, XML pipelines, Ajax callbacks, etc. In order to comply the OOP programming of PHP, the architecture of Model-View-Controller (MVC) is brought forward again. Although this idea improved PHP codes’ reuse and programming efficiency, this architecture had an obvious defect —- reduction in operating efficiency. The OOP of PHP urgently needs a new form to address the balance of efficiency and reuse.

TYPICAL PHP MODE AND MVC A. Introduction of Typical PHP Programming Mode Because of PHP’s features that it is a scripting language that is embedded in HTML documents in the implementation of the server, the format of traditional programming of PHP is closely combined with HTML documents. This results in the typical PHP programming mode of process-oriented. Embedding the PHP script according to the order of HTML document that already be designed has been the traditional format of PHP programming. It mixed the codes in data layer like the statement of database query and the codes in presentation layer like HTML.

Introduction of MVC Mode However, due to the convenience the method of OOP brought into reuse and software engineering, the architecture of Model-View-Controller (MVC) was applied. Model– View–Controller (MVC) is software’s architecture, currently considered an architectural used in software engineering. The pattern isolates “domain logic” (the application logic for the user) from the user interface (input and presentation), permitting independent development, testing and maintenance of each (separation of concerns). This saves time, creates more stable program, avoids repeated coding and promotes Rapid Application Develop (RAD). MVC is the architecture which isolates business logic and UI, and allows one changes while the other doesn’t. In the architecture of MVC, every part has its function. a. M: The Model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller). In event-driven systems, the model notifies observers (usually views) when the information changes so that they can react. a. V: The View renders the model into a form suitable for interaction, typically a user interface element. Multiple views can exist for a single model for different purposes. A viewport typically has a one to one correspondence with a display surface and knows how to render to it. b. C: The Controller receives input and initiates a response by making calls on model objects. A controller accepts input from the user and instructs the model and viewport to perform actions based on that input. In essence, MVC splits a development process of a program so that every part can be modified independently without affecting the rest. The MVC consequently separates the M from the V that was mixed before.

COMPARISON OF TRADITIONAL PHP AND MVC Due to the characters listed above, traditional structure has the following advantages. b. The structure of code is simple, making it easy to grasp and use. c. Different code can be inserted into one page file easily. d. PHP programs, HTML pages and other files can be combined into one page, reducing page requests and enhancing efficiency. However, traditional PHP structure also has the following disadvantages. a. Unduly liberty of code results in difficulty of reading and management. b. Waterfall Model and rapid development used in traditional PHP structure is much likely to create ‘spaghetti code’, which is hard to maintain and reuse. Though traditional PHP code has so many advantages, its disadvantages will lead to some severe problems that cannot be neglected. However, MVC solved those problems above well. MVC has the following advantages. c. Backstage of PHP and page of HTML are separated in order to make the structure of code more lucid, and make it convenient to debug. d. Models and class do well to maintenance of code. e. Multi-periods development and emphasis of data abstracting is convenient for management of projects. With the advantages above, MVC can solve the problems of traditional PHP structure well from the angle of software engineering. However, it is not to say that MVC has no drawbacks. It also has the following disadvantages. a. The expenditure of time is large at the early period of coding. b. The loading speed of MVC Controller engine is low. c. Involving in complicated backstage execution will to a certain degree reduce the efficiency of page running. It can be seen from the comparison that MVC is superior to traditional PHP format in the aspect of software engineering. Using MVC, a PHP application can be arranged using OOP method, making it convenient for software developers to manage it as a project. However, this convenience is at the expense of cost efficiency. As to smallsized and even medium-sized applications which emphasize runtime efficiency, MVC pattern may not be suitable, for the reason that it will increase additional workload and make the application more complicated. More specifically, MVC adds an engine on the server that pages will send requests to. Originally, PHP is a high-efficient solution, but because of the engine added by MVC, its speed is more or less influenced. Every time paper sent request to the server, the expense of launching engine is not small.

Tags: .net20192019-20202020AndroidAndroid (Operating System)Android app ideasAndroid app ideas 2019Android app ideas 2020Android app ideas for beginnersAndroid app ideas for college projectAndroid app ideas for studentsAndroid app projectAndroid app project ideasAndroid app projectsAndroid based projectsAndroid mini project topicsAndroid Mini ProjectsAndroid php projectsAndroid ProjectAndroid Project IdeasAndroid project ideas 2019Android project ideas for beginnersAndroid project ideas for computer scienceAndroid project ideas for studentsAndroid Project Ideas Of 2019Android Project Ideas Of 2020Android project ideas with source codeAndroid Project TitlesAndroid project topicsAndroid project with source codeAndroid project with source code for studentsAndroid ProjectsAndroid Projects For Final YearAndroid Projects IdeasAndroid projects listAndroid Projects TopicsAndroid Projects With Source CodeAndroid StudioAndroid Studio ProjectAndroid Studio TutorialAndroid TutorialCapstone Project TitlesCreate Android ProjectFinal Year Android Project TitlesFinal Year Android ProjectsHosurHow To Create New Android Studio Project 2019 2020Ieee ProjectsIeee Projects PhpIn Your Android ProjectJavaKumbakonamMannargudiMayiladuthuraiMca Android ProjectsMca final year projectsMca final year projects titlesMca mini project titles with abstractMca project ideasMca project titlesMca project topicsMca projects in androidMca projects in phpMca Projects TitlesMini project topics for mcaMini projects for mca 5th semPhpPhp Project TitlesPhp project topicsPhp project topics for mcaProjectProject center in hosurProject center in kumbakonamProject center in mannargudiProject center in mayiladuthuraiProject center in thanjavurProject center in trichyProject IdeasThanjavurTrichy
familyroomcafe

Recent Posts

Enhanced predictive analytics Machine Learning ideas

Machine learning is a field of study that involves the development of algorithms that allow computers to learn from data…

11 months ago

machine learning is the emergence of new project frameworks

Machine learning is a rapidly growing field that has the potential to revolutionize the way we approach complex problems and…

11 months ago

Ability to analyze and draw insights Machine learning

Machine learning has become an integral part of our lives, and it has made a significant impact on various industries.…

11 months ago

PHP Project Ideas

MCA Project Topics

Categories

Android Project Ideas