described key basic tasks should be developed for a basic WAF understanding. ... framework used for developing a wide range of web applications for both ...
IADIS International Conference Applied Computing 2013
LEARNING OF WEB APPLICATION FRAMEWORKS COMPONENTS Daniel Correa Botero, Carlos Mario Zapata Jaramillo and Fernando Arango Isaza Computer Science and Decision Department, Universidad Nacional de Colombia. Medellín, Colombia.
ABSTRACT Currently, Web Application Frameworks (WAFs) are very popular tools for developing software applications, because they employ component reuse techniques and classes for improving quality and saving costs and time. Such tools have a large number of components like classes, methods, functions, and libraries. When a developer uses one of such tools, he/she must invest too much time and effort in order to understand and learn the WAF usage. Some authors think about understanding and documenting the framework key elements (component functionality and interactions, and framework architecture) as a crucial problem. During the last year we developed a study in WAF learning with six system engineer students, and we created our own WAF for pedagogical purposes. Then we defined 13 WAF main components and we described key basic tasks should be developed for a basic WAF understanding. In this paper, we propose a knowledge representation about WAF learning based on the so-called pre-conceptual schemas for representing WAF basic concepts, knowledge bases, and main components. Also, we define these main components and their key basic tasks. A developer would use this material as a getting started guide, in which he/she can identify the basic concepts, main components and the things he/she needs to learn. These representations and components can be also used for WAF comparison and learning studies. KEYWORDS Framework learning, WAF, pre-conceptual schemas, framework comprehension, WAF components.
1. INTRODUCTION Framework development is a powerful technique for large-scale reuse that helps developers to improve quality and reduce costs and time (Flores & Aguiar, 2010; Hou, 2008). A WAF is a specific type of framework used for developing a wide range of web applications for both inter- and intra-nets (Yang et al., 2002; Halfond, 2012). Nowadays, WAFs are considered indispensable for rapid web development (An et al., 2009). Most WAFs (e.g. CakePHP, Spring, Prado, and Ruby on Rails) offer websites, forums, blogs, plugins, bug fixes, and much more. However, before starting to use a WAF, some developers—especially first-time users—have to invest considerable effort on understanding it (Flores & Aguiar, 2008), a situation that raises software development costs. Some authors see the understanding of the framework key elements as a crucial problem; in particular, they are interested in component functionality (Shull et al, 2000), component interactions, and framework architecture. Also, the techniques to be used for documenting frameworks are study subjects (Kirk et al., 2007). At the beginning of the software development process, some developers only devote their time on trying to understand how the components work. So, no progress is reached for developing the final application, raising the cost for developing software in companies and organizations. Some documentation techniques have been proposed to help the general framework understanding (Flores & Aguiar, 2010). Such techniques include: patterns (Johnson, 1992), example-based learning (Shull et al., 2000), cookbooks (Krasner & Pope, 1988), and visualizations (Jackson et al., 2010). However, no matter the large amount of documentation available for most frameworks, we have found that developers commonly use one type of documentation technique: cookbooks. Also, techniques for WAF understanding are still not studied in detail.
155
ISBN: 978-989-8533-20-3 © 2013 IADIS
During the last year, we conducted a study in WAF learning, working with a group of six system engineering students. A WAF (Codeigniter, Yii, Prado, MVC4, Ruby on Rails, and Cakephp) was assigned to each student. Based on specific tasks and goals, each student presented what components were involved and how they were used to develop such tasks. In our study, we found more similarities than differences among WAFs. We concluded the WAF learning is summarized into learning to use 13 main components for novice developers. Also, we defined the key basic tasks for developing skills in the usage of such components. In this paper we aim to help developers during the learning process by presenting the WAF main components and the key basic tasks associated with understanding and using such components. A developer will use this material as a getting started guide with the overview of how WAFs are composed and what things he/she needs to learn. The remainder of this paper has the following structure: first, we summarize an approach to the WAF basic concepts, WAF knowledge bases, and problems related to framework learning. Then, based on official documentation and the experience collected during the last year, we propose a representation of the main WAF components; each component is associated with the key basic tasks—which a developer should do in order to learn the use of the component. Later, we develop an example of the proposed representation in one component of Codeigniter showing its key basic tasks and other information. Finally, we discuss the conclusions and the future work by promoting the application of these representations and components for WAF comparison and learning studies.
2. WAF LEARNING ENVIROMENT WAF learning is difficult to achieve because these tools have many components, such as: role manager, error handler, route manager, and cache component, among others. These components are crucial to software reuse techniques, but too many components are involved in complex WAF development technologies (Flores & Aguiar, 2010; Hou, 2008; Hou & Li, 2011). Most WAF learning environment includes some resources like websites, forums, and blogs, among others. In Fig. 1 we use the so-called pre-conceptual schemas (Zapata et al, 2006) for representing this environment. Be advised that novice developers lack the needed experience and ignore what WAF facilities are available to them, so they do not know what to look for. Sometimes, the only guidelines for developers are the official documentation, regarding other knowledge bases from which they can extract information. In other cases, they are assigned to an expert developer or a partner who guides him/her in the learning process. In such cases, time-usage and teaching-based constraints leave the novice developers unguided. By pointing the key components the developer have to look for—during WAF understanding process— and by presenting the learning tasks associated with each element, we expect to significantly improve the WAF learning process.
3. MAIN WAF COMPONENTS AND ASPECTS At first sight, each WAF seems to be independent and unique, but actually many of them have much in common. In fact, several framework comparison studies show many components and similarities between them (Canales, 2010; Wang, 2008).
156
IADIS International Conference Applied Computing 2013
Figure 1. A pre-conceptual schema for representing the WAF learning environment.
These components support one or more software aspects. We consider aspects as requirements for which the WAFs should provide facilities for each application, e.g. developing a user interface, controlling data flow, and implementing security, among others. During the last year, we built seven applications—e.g., currency converter, create-read-update-delete (CRUD) facilities for several database management systems, a light course application, data validations, and so on—covering a diverse set of aspects in various WAF (Codeigniter, Yii, Prado, MVC4, Ruby on Rails and Cakephp). Table 1 shows the aspects involved in developing such applications. Table 1. WAF Aspects Aspect User Interface
Data flow control
Security Database Management Data modeling Performance Code generation
Description This aspect ensures a device by which the end user interacts with the application. Commonly, some data input is accepted and some data output is supplied by generating web pages. Related to this aspect, WAFs can support: views of static lists and tables with model information, information editing, and interface connection, among others. This aspect ensures the proper flow of information. WAFs can support: handling the information layer by layer, catching errors, etc. This aspect is focused on security information. The user only should access zones that he had granted for. The WAF should validate data restrictions and provide other devices to keep the information saved from intruders. Related to this aspect, WAFs can support: logging, and role manager, among others. This aspect ensures the communication with relational databases. WAF should support components or functions for accessing information from the database. This aspect ensures the communication between objects and relational databases. WAF should support the transformation of information between them. This aspect is focused on optimizing resource usage and improving the design of application. It can also serve to investigate and validate quality attributes of the application, such as scalability, and reliability, among others. This aspect is focused on facilitating the code generation for saving time to developer. WAFs should provide tools for that goal.
No matter we use different WAF components in order to build similar applications we recognize we are using the same purpose-oriented components, such as: error handler, data validation, role manager, ORM, AJAX, auto-code generators, and template manager, among others. Consequently, the WAF facilities should be considered the same. Their differences were essentially related to syntax and WAF functionalities. In addition, as the studied WAFs used the same model-view-controller (MVC) architectural pattern, we decided to group the components according to the architectural layer in which each component tends to be used. For example, if we have a component that sets how errors are captured and showed, then we recognize it as an “error-handling” component, usually, this component is used in the control layer. We believe this classification will allow the developer to know exactly which components are available for a specific
157
ISBN: 978-989-8533-20-3 © 2013 IADIS
architectural layer. Then, the developer knows that "error-handling" is a process performed only by the controllers. We decided to use a unique name for each component. For example, the component responsible for establishing a device for accessing the methods or functions of a controller (routes) in the Yii framework is called "URL Management," while in Codeigniter is called "URI Routing." Instead of identifying their names, we decided to call that component "Route Manager." A developer working with different WAFs can understand what components are shared by the WAFs and what components are new. In parallel with this study, we created two php frameworks from scratch, one of them called FrameworkG (for general purposes) and the other one called PISIS Framework (for creating university courses). With this work, we could address the main problems developers of frameworks have to deal with. Besides, we identified how some components were constructed and how they established some communication with others components. Based on the above statements we established 13 WAF main components, which are the most used for developing basic applications. These components are shown in Table 2. We consider basic applications as: - Applications with minimum security (data validation, and authentication). - Applications that allows showing, editing, saving, and deleting information. - Applications that use a database manager. Table 2 includes WAF main components, its description, the associated layers, the supported aspects and key basic tasks. These tasks are created based on our experience developing software applications in WAFs for the university, and using WAFs for real projects. Table 2. WAF Main Components (part 1 of 2) Associated layers
Supported aspects
Superclass model
It provides a list of useful methods, functions and variables can be used by models for extension purposes.
Model
Data modeling
Superclass Controller
It provides a list of useful methods, functions and variables can be used by controllers for extension purposes.
Controller
Data flow control
Route Manager
It establishes a device for accessing controller methods or functions
Controller, view
Data flow control
Error Handler
It defines the way to catch and show the errors.
Controller
Data flow control
Database Class
It defines the way for accessing, editing, or saving information into the database by using controllers and objects.
Controller, model
Database manager
Component Description
158
What should a developer learn to use each component? (Tasks) - Identify what functions are available. - Identify how to create model classes and what functions should be override. - Identify how to create new class functions. - Identify how to call attributes and functions classes. - Identify what functions are available. - Identify how to create controller classes and what functions should be override. - Identify how to call model classes. - Identify how to call libraries or plugins. - Identify how to call views. - Identify how to receive data from views. - Identify how the variables get, post, session, and files are treated. - Identify how to do redirects. - Identify how to show results by pages. - Identify how URLs are and what means each part of the URLs. - Identify how to send and receive data from URLs. - Identify what the sections to catch errors are. - Identify what the types of errors are. - Identify how to capture and show these errors. - Identify how to connect to a specific database. - Identify how to add data to the database. - Identify how to delete data from the database. - Identify how to edit data from the database. - Identify how to select data from the database (even information from various tables). - Identify additional functions or functionalities.
IADIS International Conference Applied Computing 2013
Table 2. WAF Main Components (part 2 of 2) Component Description
Template Manager
Role Manager
Data Validation
Cache
Helper
ORM
Automatic code generator
Tester
Also called "template engine," it provides communication bridges between controllers and views and defines some functions and special syntax in both layers. It provides a way to verify whether or not a user is granted to manipulate specific resources, or whether he/she is allowed to enter to specific zones. It defines how to validate that information in objects or variables is right. In some cases this component is associated with the model layer. Besides, sometimes it defines a list of functions or elements to check the right type of variables. It defines a way of caching webpages, in order to achieve maximum performance and improve the server load. Helpers are collection of functions in a particular category. They are helpful for doing tasks. For example, some URL Helpers support the link creation and the element form creation, among others.
Associated Supported layers aspects
View
User interface
What should a developer learn to use each component? (Tasks) - Identify if a different syntax is used in the view layer and how it works. - Identify how the communication between controller and view layers is achieved. - Identify what functions are available. - Identify how the variables get, post, session, and files are treated.
Security
- Identify how to validate permissions in the application. - Identify how to grant access to specific areas. - Identify how to add types of roles.
Controller, model, view
Security
- Identify how validations in control layer are treated. - Identify how validations in view layer are treated. - Identify how validations in model layer are treated. - Identify what kinds of validations are predefined. - Identify how to create new validation types.
Controller
Performance
- Identify how to call cache. - Identify where cache is used.
Controller, view
Data flow control, user interface, security.
- Identify what kinds of helpers exist. - Identify where helpers are defined. - Identify what facilities give each helper and how to use them.
Data modeling
- Identify how the transformation among relational databases and class objects is achieved. - Identify how various objects are gathered from different classes. - Identify how one-one and many-many relations, among others, are treated. - Identify how to call specific SQL statements
Code generation
- Identify how to call and use auto-code generators. - Identify what information is created and how to edit it. - Identify how to delete that information.
Data flow control, performance
- Identify how to create unit tests - Identify how to debug information.
Controller
It defines a mapping between objects and relational databases. Some WAFs use Controller, their own classes (or model functions in the model layer) and others use ORM programs. It provides a way to automatically generate code, e.g. in some cases WAFs provide a CRUD module Controller (create-read-update-delete). This module usually works adding information from a form. It provides a device to test and debug your applications, to find possible bugs, with real data or sample data. It Controller allows you to show debugged information about the contents of variables.
159
ISBN: 978-989-8533-20-3 © 2013 IADIS
Unofficial WAF components—such as special plugins and libraries—are not listed in Table 2 (e.g., excel plugin, pdf plugin, and calendars, among others) because, in most cases, they are created by common users and they are uploaded onto the forums. Also, we avoid considering these components and others as main components because they are not used by most basic applications. Be advised that not all WAFs have all these components. Also, tester, automated code generator, and cache components might not be necessary in order to develop basic applications, but they could be useful. In Fig. 2 we propose some of the WAF basic attributes and components. One feature of this schema is the possibility of be applied to any of the six previously used WAFs (in the next Section we show an example). Also, this schema allows for identifying and classifying the main components in each layer. In some cases, one component could belong to two layers, e.g. data validation could be used in the model and in the controller. Each task has a goal, and a documentation which solves its goal. Examples of documentation are: links to videos, short descriptions, and links to forums. Examples and knowledge bases are also welcomed as documentation.
Figure 2. A pre-conceptual schema for representing the main WAF components.
4. REPRESENTING ONE COMPONENT OF CODEIGNITER The main WAF components depicted in the Fig.2 can be exemplified by representing an actual WAF. We selected Codeigniter for this purpose. We extend the use of pre-conceptual schemas by using the so-called executable pre-conceptual schemas (Zapata et al., 2011) in order to represent our example. In Fig. 3 we propose the representation of the "Error handler" component of Codeigniter. In this Figure we represent the component key basic tasks and documentation. Besides, we provide some information to the developer about what he/she will find and what he/she will need to use from that component. Such information could be used as a starting point for developing the component. Also, the representation provides a link to where to go for more information. An expert can pick up some information for completing the pre-conceptual schema, and can provide such information to novice developers. Also, the use of executable pre-conceptual schemas could be useful in order to create a functional application in which the Meta model information is stored. We expect to develop some learning studies about the usage of this pre-conceptual schema in the future. Especially, we expect to be focused on completing and testing such schema by using micro-learning (Hug, 2007) and example-based learning.
160
IADIS International Conference Applied Computing 2013
Figure 3. An executable pre-conceptual schema for representing the "error handler" component of Codeigniter.
5. CONCLUSIONS AND FUTURE WORK WAF learning is an activity in which developers are spending too much time and effort. In this paper we proposed several pre-conceptual schemas and information about the basic WAF concepts, knowledge bases, and main components in order to help the developer with the WAF learning process. WAFs have some similarities and share some components. Based on this fact and previous studies, we proposed a list of 13 main components. We defined some tasks that a developer should learn to develop for each component. We consider that, for novice developers, the MVC WAF learning is summarized by the tables we created. In the specific WAF pre-conceptual schemas, we grouped these components with the layer in where they are used. This grouping process allows for identifying what components are used in each layer in a specific WAF. Future work for evolving this study will be devoted to create a list of examples to cover learning aspects about WAF components and their associated tasks. This list can be used in a WAF example-based learning study. Also, some material should be developed for WAF learning and comparison. Finally, some validation is needed for the tables we created, in order to complete other MVC WAFs, especially in others languages like java and python.
REFERENCES An, J. H. et al, 2009. Static typing for Ruby on Rails. Proceedings of 24th IEEE/ACM International Conference on Automated Software Engineering, Auckland, New Zealand, pp. 590-594. Canales, M., 2010. A Comparative Study of Rapid Development Frameworks for the Creation of a Language Placement Exam Template. Doctoral dissertation, Texas A&M University. Flores, N., and Aguiar, A., 2008. Patterns for understanding frameworks. Proceedings of 15th Conference on Pattern Languages of. Programs (PLoP), Nashville, TN, USA, pp. 8. Flores, N., and Aguiar, A., 2010. Understanding Frameworks Collaboratively: Tool Requirements. International Journal On Advances in Software, Vol. 3(1 and 2), pp. 114-135. Halfond, W. G., 2012. Automated Checking of Web Application Invocations. Proceedings of IEEE 23rd International Symposium on Software Reliability Engineering (ISSRE), Dallas, TX, USA, pp. 111-120 Hou, D., 2008. Investigating the effects of framework design knowledge in example-based framework learning. Proceedings of 24th IEEE International Conference on Software Maintenance, Beijing, China, pp. 37-46.
161
ISBN: 978-989-8533-20-3 © 2013 IADIS
Hou, D., and Li, L., 2011. Obstacles in using frameworks and apis: An exploratory study of programmers' newsgroup discussions. Proceedings of IEEE 19th International Conference on Program Comprehension (ICPC), Kingston, ON, Canada, pp. 91-100. Hug, T., 2007. Didactics of microlearning: concepts, discourses and examples. Waxmann Verlag GmbH, Germany. Jackson, K. et al, 2000. Understanding frameworks through visualisation. Proceedings of 37th International Conference on Technology of Object-Oriented Languages and Systems, Sydney, Australia, pp. 304-315. Johnson, R. E., 1992. Documenting frameworks using patterns. ACM Sigplan Notices, Vol. 27, No. 10, pp. 63-76. Kirk, D. et al, 2007. Identifying and addressing problems in object-oriented framework reuse. Empirical Software Engineering, Vol. 12(3), pp. 243-274. Krasner, G. E., and Pope, S. T., 1998. A cookbook for using the model-view-controller user interface paradigm in Smalltalk-80. Journal of Object-Oriented Programming, Vol. 1(3), pp. 26–49. Shull, F. et al, 2000. Investigating reading techniques for object-oriented framework learning. IEEE Transactions on Software Engineering, Vol. 26(11), pp. 1101-1118. Wang, P., 2008. Comparison of Four Popular Java Web Framework Implementations: Struts1. X, WebWork2. 2X, Tapestry4, JSF1. 2. Doctoral dissertation, Master’s Thesis, University of Tampere. Yang, J. T. et al, 2002. Constructing and Object-Oriented Architecture for Web Application Testing. Journal of Information Science and Engineering, Vol. 18(1), pp. 59-84. Zapata, C. M. et al, 2006. Pre-conceptual schema: A conceptual-graph-like knowledge representation for requirements elicitation. Lecture Notes in Computer Science, Vol. 4293, pp. 17–27. Zapata, C. M. et al, 2011. Esquemas preconceptuales ejecutables. Avances en Sistemas e Informática, Vol. 8(1), p. 2.
162