<<

Component Based Development Using the PRADO Framework

Zaitun A. B. and Vanisri Ramasamy Department of Information Science, Faculty of Computer Science and Information Technology, University of Malaya, Kuala Lumpur, Malaysia.

Tel no: +603 7976432 Fax. No: +603 7579249 [email protected]

ABSTRACT Organizations require efficient information systems to support their daily operations in order to remain competitive and have a cutting edge over their contenders. These information systems need to be ready at a fraction of the time given to systems development work in the pre-Internet era. One of the numerous approaches to cut development time is software reuse. In this paper, we present to the readers our findings and experience in developing a web-based system using component-based development with the PRADO framework.

In this paper, we will be focusing on software reusability concept using component-based software engineering, design patterns and frameworks and identify the approach to be used to develop the Postgraduate Student Administration System (PSAS). We will examine a few of the available free web application framework, which focuses on the open source technology, analyze the advantage and identify the web application framework to develop PSAS – a system that can be implemented in academic institutions to administer the postgraduate student’s dissertation data.

Keywords: Component Based Development, Application Framework, Software reusability

adopting the software reusability approach 1. Introduction to system development. Reuse based The Internet has changed the way we software engineering is an approach that conduct our business and the way we tries to maximize the reuse of existing communicate. Business and daily software. According to Boehm (1984), communications now moved at a very much software reuse will be one of the major faster pace. In order to remain competitive, sources of saving in software development business organizations need the support of over the next 15-20 years. By reusing efficient and flexible web-based information systems or system parts that already have systems. Therefore there is a need for been developed, an organization enhances organizations to develop these web its possibilities to both improve the applications quickly in order to meet productivity and the quality of the produced customers’ requirements. There is also a software. Since software reuse costs are need to reduce the process risk and increase often higher than expected, several the reliability of these web applications. approaches to development with reuse have These requirements can be fulfilled by been proposed. Sommerville (2004), pointed

1 out that component-based or component- parts of an application can simply inherit based software engineering, design patterns from pre-existing classes in the framework. and application framework will be useful techniques in implementing software Application Frameworks and reusability. Web application developers can Components use the approaches to develop a robust and Components provide the developer with a high quality web application quickly. group of classes and abstractions to inherit from or instantiate them. Unlike frameworks, components are more general 2. Application Framework and are not tied to a specific application Wirfs-Brock and Johnson (1990) defined a domain. framework as a sub-system design made up of a collection of abstract and concrete Frameworks use components and extend classes and the interface between them. their benefits in two ways: Particular details of the application sub- 1. By using a framework, not only the system are implemented by adding classes are instantiated or inherited components and by providing concrete but also the underlying architecture. implementations of abstract classes in the 2. Frameworks are active and exhibit framework. Frameworks are rarely "inversion of control" at run-time. applications on their own. Applications are Inversion of control, one of the constructed by integrating a number of primary benefits of frameworks. frameworks. A framework is a generic structure that can be extended to create a Application Frameworks and Design more specific sub-system or application. It is Patterns implemented as a collection of concrete and During the development process of complex abstract object classes. software systems, developers may face some programming problems. Some of these An application framework actually refers to problems repeatedly appear in their next a set of libraries or classes that are used to software projects. Until mid-1990s, the implement the standard structure of an solutions of these problems were located application for a specific operating system. only in the minds of expert developers. This By bundling a large amount of reusable code is not the ideal location. The documentation into a framework, much time is saved for the of these problems and their proven solution developer, since the task of rewriting large is now known as "design patterns." Patterns amounts of standard code for each new support the reuse of design expertise by application that is developed is saved. articulating the static and dynamic aspects of Application frameworks became popular successful solutions to problems that arise with the rise of the graphical user interface when building software in a particular (GUI), since these tended to promote a context. Patterns guide framework design standard structure for applications. It is also and use. Patterns can be viewed as more much simpler to create automatic GUI abstract micro-architectural elements of creation tools when a standard framework is frameworks that document and motivate the used, since the underlying code structure of semantics of frameworks in an effective the application is known in advance. way. Frameworks are often instantiations of a number of patterns. Object-oriented Web Application Framework programming techniques are usually used to A framework is an extensible structure for implement frameworks such that the unique describing a set of concepts, methods, technologies, and cultural changes necessary

2 for a complete product design and There are many free frameworks available to manufacturing process. Frameworks provide choose from. Some of the web application a mechanism that guides users through a frameworks that have been evaluated for this proper order of steps, applications, and data dissertation are based on open-source web conversions via a common interface to the application frameworks in PHP. Those process being followed. A framework frameworks are as below: consists of a set of super classes, APIs, and other libraries appropriate for solving a a. .MVC particular domain of problems (in this case, php.MVC (Wildenauer, 2006) implements developing a Web application) (Package the Model-View-Controller (MVC) design Aquarium, 2005) pattern, and encourages application design based on the Model 2 paradigm. This design Choosing a Web Application Framework model allows the or other When choosing a framework we should contents (View) to be mostly separated from consider answering the following question: the internal application code (Controller/Model), making it easier for · Does the framework handle most things designers and to focus on their that are common to applications of the kind respective areas of expertise. The framework you wish to develop? provides a single entry point Controller. The · Does the framework have a strong user Controller is responsible for allocating community to back it? HTTP requests to the appropriate Action · How much does the framework cost? handler (Model) based on configuration · How steep is the learning curve for the mappings. The Model contains the business framework? logic for the application. The Controller then forwards the request to the appropriate View The cost is an important factor—although component, which is usually implemented "free" in most cases also means widespread using a combination of HTML with PHP usage, community support, and no tags in the of templates. The resulting dependence on a single vendor. It takes contents are returned to the client browser, some time for developers to get used to a or via another protocol such as SMTP. framework and be good at it. So choose a php.MVC is a PHP port of Jakarta Struts. It framework as a long-term strategy. You currently supports many features of Struts, cannot be switching frameworks for every including declarative application project. Sticking with one framework also configuration via the XML digester. For helps as once the expertise in that example, mappings from the various Action framework builds up; customizing the business logic components to appropriate framework also becomes a possibility. results pages can be specified declaratively in the XML configuration file. A tempting option is for organizations to build their own framework to address needs b. binarycloud specific to the kind of work the organization binarycloud (Turing, 2006) is a web undertakes. Thoroughly testing and application framework for the PHP maintaining a framework is a huge task that language. It provides a set of services that will need dedicated people resources. These are frequently used when writing web few people become critical and are the only applications and helps to improve reusability source of support for others using that by providing a modular application framework. infrastructure. The centrepiece of this framework is the presentation system (Node Tree), which enforces a strict separation of

3 your business logic from your presentation PRADO re-conceptualizes Web application logic. The Node tree uses a unique, development in terms of components, events hierarchical scale free object design that is and properties instead of procedures, URLs extremely powerful because applications can and query parameters. A PRADO be arbitrarily infinitely nested. The Smarty component is a combination of a template engine is the default rendering specification file (in XML), an HTML layer and is tightly integrated into template and a PHP class. PRADO binarycloud. components are combined together to form larger components or complete PRADO c. Achievo ATK pages. Developing PRADO Web Achievo ATK (ATK5, 2006) is an object applications mainly involves instantiating oriented Web Application Framework, pre-built and application-specific component written in PHP. It is targeted at developers types, configuring them by setting their who wish to focus on business logic, instead properties, responding to their events by of coding HTML. Where other application writing handler functions, and composing frameworks mainly provide a large set of them into application tasks. utility classes, ATK provides a complete framework that requires only small amounts The benefits that PRADO provides to Web of code to get usable applications, while application developers are as below maintaining full flexibility. In other words, developers: even 10 lines of code get you a working · Reusability - Codes following the application, but everything generated for PRADO component protocol are you, can be 100% customized. It is Achievo highly reusable. Everything in ATK’s belief that will revolutionize the way PRADO is a reusable component. business applications are built. Therefore · Ease of use - Creating and using ATK is referred as a 'business framework' or components are extremely easy. 'enterprise framework'. Usually they simply involve configuring component properties. . Smarty · Robustness - PRADO frees Although Smarty is known as a "Template developers from writing boring, Engine" (Smarty Template Engine, 2006), it buggy code. They code in terms of would be more accurately described as a objects, methods and properties, "Template/Presentation Framework." That instead of URLs and query is, it provides the and template parameters. The latest PHP5 designer with a wealth of tools to automate exception mechanism is exploited tasks commonly dealt with at the that enables line-precise error presentation layer of an application. Smarty reporting. is not a simple tag-replacing template · Performance - PRADO uses a cache engine. Although it can be used for such a technique to ensure the performance simple purpose, its focus is on quick and of applications based on it. The painless development and deployment of performance is in fact comparable to application, while maintaining high- those based on commonly used performance, scalability, security and future template engines. growth. · Team integration - PRADO enables separation of content and e. PRADO presentation. Components, typically PRADO (PRADO Group, 2006), is a pages, have their content (logic) and component-based and -driven Web presentation stored in different files. programming framework for PHP 5. 4 PRADO focuses more on establishing a The system is realized through the standard of reusing codes and event-driven PRADO’s 3-Tier architecture as shown in programming. Experienced Windows Figure 1. The figure describes that the programmer using Visual Basic or system consists of presentation layer, service will find Web programming with PRADO is layer and data access layer. Designing very similar. Most of the time, the only thing application in layers, or tiers, is useful for needed to be done is to set component many different reasons. Efficient layering properties and respond to component events. can give structure to the application, Higher level of code reusability can be promote scalability, and ease long-term achieved based on PRADO components. maintenance requirements for code. The advantages of 3-Tier architecture are as below:- 3. The Development of PSAS · Clear separation of user-interface- Academic institutions are currently faced control and data presentation from with the challenging problem of managing application-logic. Through this as well as administrating student data, which separation more clients are able to is growing every day. The higher the student have access to a wide variety of level the more complicated is his/her server applications. The two main information profile. The task of keeping advantages for client-applications are track of a post-graduate student who is clear: quicker development through doing research under a lecturer is often so the reuse of pre-built business-logic cumbersome that departments run shadow components and a shorter test phase, spreadsheets often resulting in inaccurate because the server-components have data. In a wider context, in an educational already been tested. environment which is supported by different · Re-definition of the storage strategy department, the absence of a universal won’t influence the clients. RDBMS’ means of identifying students resulted in offer a certain independence from using different enrollment networks and not storage details for the clients. having the capacity to transfer student However, cases like changing table records across department makes the data attributes make it necessary to adapt management process difficult. Therefore, an the client’s application. In the future, online database system, which is capable of even radical changes, like let’s say integrating to the main student database and switching form an RDBMS to an display as well as manages the student’s OODBS, won’t influence the client. research progress, is badly needed. In well designed systems, the client The focus of this project is to provide such still accesses data over a stable and integration through an object model for well designed interface which student record. This object model will be encapsulates all the storage details. accessed through a web gateway to a meta- · Business-objects and data storage directory, a virtual database that abstracts all should be brought as close together information. Parallel to the development and as possible, ideally they should be prototyping of the object model is the design together physically on the same and development of a website by utilizing server. This way - especially with the software reusability concept. Web complex accesses - network load is application framework is the approach eliminated. The client only receives identified to utilize the software reusability the results of a calculation - through concept in developing the PSAS system. the business-object, of course. · In contrast to the 2-tier model, where only data is accessible to the public,

5 business-objects can place occur, the server process can be applications-logic or "services" on moved to other servers at runtime. the net. As an example, an inventory · Change management: of course it’s number has a "test-digit", and the easy - and faster - to exchange a calculation of that digit can be made component on the server than to available on the server. furnish numerous PCs with new · As a rule servers are "trusted" program versions. It is, however, systems. Their authorization is compulsory that interfaces remain simpler than that of thousands of stable and that old client versions are "untrusted" client-PCs. Data still compatible. In addition such protection and security is simpler to components require a high standard obtain. Therefore it makes sense to of quality control. This is because run critical business processes that low quality components can, at work with security sensitive data, on worst, endanger the functions of a the server. whole set of client applications. At · Dynamic load balancing: if best, they will still irritate the bottlenecks in terms of performance systems operator.

Figure 1 below shows the system architecture.

Presentation Service Data Access

Web Controls Title MySql PSAS User and Management Impl Interfac events database

Student Dao Mysql Management Result Impl database

Admin Management

Submission Management

Figure 1: PSAS System Architecture specification files (*.spec). The classes to be inherited from the framework will be 4. System Implementation identified and the coding of the hotspot and The system is implemented using the three the data module as well as the user interface layered architecture which are the will be done in this stage. The following presentation (*.tpl), service (*.php), and data files were created to demonstrate the access (*.php). Apart from this, every application of the PRADO framework: module will have an application 6 · ipsas.php, the main entry to the · usermodule/UserModule.php, the data application; module file. · application.spec, the application specification file; The usermodule directory should be · global/IpsasUser.php, the page user configured inaccessible to end-users because file; it contains sensitive application information. · usermodule/LoginPage.php, the page class file Table 1 summarizes the entire Template · usermodule/LoginPage.tpl, the page Files with Class and Data Module Files for template file. each module in PSAS.

Table 1: A Summary of Template Files with Class and Data Module Files for each module in PSAS. Module Data Module Files Template Files (.tpl) Class Files (.php) Description (.php) UserModule UserModule.php LoginPage.tpl LoginPage.php Logging in user. NewPage.tpl NewPage.php Creating new EditPage.tpl EditPage.php user Editing a user AdminModule AdminModule.php AdminLayoutPage.tpl AdminLayoutPage.php AdminMenuBar.tpl AdminMenuBar.php ViewAllPage.tpl ViewAllPage.php ViewUserPage.tpl ViewUserPage.php NewPage.tpl NewPage.php EditPage.tpl EditPage.php UpdateProfile.tpl UpdateProfile.php ViewAllUserPage.tpl ViewAllUserPage.php ExaminerAppPage.tpl ExaminerAppPage.php NewSubmission.tpl NewSubmission.php EditSubmission.tpl EditSubmission.php AccessDenied.tpl AccessDenied.php ErrorPage.tpl ErrorPage.php LecturerModule LecturerModule.php LecturerLayoutPage.tpl LecturerLayoutPage.php LecturerMenuBar.tpl LecturerMenuBar.php UpdateProfile.tpl UpdateProfile.php BorangA.tpl BorangA.php BorangB.tpl BorangB.php BorangC.tpl BorangC.php StudentModule StudentModule.php StudentLayoutPage.tpl StudentLayoutPage.php StudentMenuBar.tpl StudentMenuBar.php NewPage.tpl NewPage.php ViewAllPage.tpl ViewAllPage.php NewStudentPage.tpl NewStudentPage.php EditStudentPage.tpl EditStudentPage.php EditStudentDetPage.tpl EditStudentDetPage.php StudentModule.tpl StudentModule.php TitleModule TitleModule.php TitleLayoutPage.tpl TitleLayoutPage.php TitleMenuBar.tpl TitleMenuBar.php NewPage.tpl NewPage.php EditPage.tpl EditPage.php ViewPage.tpl ViewPage.php ByStatusPage.tpl ByStatusPage.php ExaminerModule ExaminerModule.php ExaminerLayoutPage.tpl ExaminerLayoutPage.php ExaminerMenuBar.tpl ExaminerMenuBar.php UpdateProfile.tpl UpdateProfile.php MarkingPage.tpl MarkingPage.php ExaminationPage.tpl ExaminationPage.php IExaminationPage.tpl IExaminationPage.php IMarkingPage.tpl IMarkingPage.php IExaminationListPage.tpl IExaminationListPage.php IMarkingEditPage.tpl IMarkingEditPage.php 7 5. Conclusion Oriented Design. Commun. ACM 33(9): The web application framework was 104-124 (1990) selected as the approach that will be used to develop the PSAS system mainly because it Package Aquarium, 2005, can speed up development process. Even http://aquarium.sourceforge.net/api/public/a though it takes a longer time to develop a quarium-module.#webapp Last access system using an application framework at date: 5 September 2006. first, eventually when the framework has been used for several different systems Wildenauer J. C. php.MVC, development, the development time will be http://phpmvc.net/ last access date: 5 shortened. Furthermore, there is a lot of September 2006. readily and freely available application framework which can be utilized to develop Turing(2006), http://www.binarycloud.com/ the system which makes the development last modified 17 April 2006, last access date: process easier. 5 September 2006.

Increasing demands for web application has ATK5, http://www.achievo.org/atk, last urged the e-business development access date: 5 September 2006. organization to identify the best possible method to develop applications quickly Smarty Template Engine (2006) without affecting the quality of the http://smarty.php.net/ last access date: 5 application in order to maintain the September 2006. customers. Through this research project, it has been proven that robust and high quality PRADO Group (2006), web application development can be http://www.pradosoft.com/ last access date: achieved through implementation of reuse 5 September 2006. based software engineering approach concentrating on web application framework. Implementation of this web application framework requires a high learning curve and training cost to learn the application. However, this implementation cost is a one time cost and organization can save a lot substantial amount of money through shorter software development time.

References:

Boehm B., Software Engineering Economics (Englewood Cliffs, NJ : Prentice-Hall, 1981

Sommerville I., Software Engineering, (7th Ed.). England: Pearson Education Limited, 2004

Wirfs-Brock R, and Johnson R. E.: Surveying Current Research in Object-

8