TAILIEUCHUNG - Developing Large Web Applications- P15

Developing Large Web Applications- P15:This book presents a number of techniques for applying established practices of good software engineering to web development—that is, development primarily using the disparate technologies of HTML, CSS, JavaScript, and server-side scripting languages. Whereas there are many books on how to use languages, how to use libraries, and how to approach software engineering, this is the first book to codify many of the techniques it presents. These techniques will make the components of your own web applications more reusable, maintainable, and reliable | Defining get_data The get_data method of a data manager abstracts the process of getting data from the backend. A key part of implementing a clearly defined data interface for getting data is to define well-organized data structures for each of the parameters that get_data accepts or returns public function get_data load_args load_data load_stat load_args Input arguments needed for getting the data for example configuration settings a database connection or the maximum number of items in a list of data to retrieve. Since more than one input argument is frequently required an associative array works well for this data structure. load_data A reference for where to place the retrieved data. Since more than one data member is frequently retrieved an associative array works well for this data structure. load_stat A reference for where to return the status of the operation. A status indication may be a numeric code or a string in the simplest situations or it could be an associative array that provides more details. Defining set_data The set_data method of a data manager abstracts the process of setting data in the backend. public function set_data save_args save_data save_stat The set_data method of a data manager uses the same arguments and internal structures as get_data except save_data is the data to save. This argument is a reference so that a data manager has the option to pass back some data after saving. Extending Data Managers Often it makes sense to build on existing data managers when creating new ones. For example you might create a data manager that relies on common methods for working with web services from another data manager or combine access to multiple finer-granularity data managers within a single data manager that a page can instantiate on its own. The extension of data managers offers more than just a convenience it also provides the opportunity for certain optimizations. For example you might encapsulate how you share database connections or file

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.