PHP 5/MySQL Programming- P55

PHP 5/MySQL Programming- P55:computer programming has often been seen as a difficult and arcane skill. Programming languages are difficult and complicated, out of the typical person’s reach. However, the advent of the World Wide Web has changed that to some extent. It’s reasonably easy to build and post a Web page for the entire world to see. The language of the Web is reasonably simple, and numerous applications are available to assist in the preparation of static pages | 248 PHP 5 MySQL Programming for the Absolute Beginner td Joe td tr tr td options td td 1 td tr tr td name td td Jonathon td tr tr td address td td 123 W 4th St td tr tr td phone td td 999-9999 td tr tr td number td td 3 td tr table body html Understanding OOP The SuperHTML project uses many OOP features to do its work. Before digging into the innards of SuperHTML itself it makes sense to think more about what objects are and how to create them in PHP. Objects Overview As you ve seen objects have properties which are characteristics of the object and methods which are things the object can do. In addition to supporting properties and methods a properly designed object should reflect certain values of the object-oriented paradigm. 249 Many discussions of OOP indicate that objects also have events. An event is some sort of stimulus the object can respond to. Events are indeed important in OOP but they are not often used in PHP programming because events are meant to capture things that happen in real time. PHP programs rarely involve real-time interaction with the user so events are not as critical in PHP objects as they are in other languages. Encapsulation An object can be seen as some data the properties and some code the methods for working with that data. Alternatively you could see an object as a series of methods and the data that supports these methods. Regardless you can use an object without knowing exactly how it is constructed. This principle of encapsulation is well supported by PHP. You take advantage of encapsulation when you build ordinary functions. Objects take the notion of encapsulation one step further by grouping together code and data. Inheritance Inheritance is the idea that an object can be inherited from another object. Imagine if you had to build a police car. You could build a factory that begins with sheet metal and other raw materials or you could start with a more typical car and simply add the features that make it a police car. .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.