TAILIEUCHUNG - Embedding Perl in HTML with Mason Chapter 10: Scalable Design

Tham khảo tài liệu 'embedding perl in html with mason chapter 10: scalable design', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 10 Scalable Design So now that you know how to do things with Mason it s time to start thinking about how to do things cleanly scalably and maintainably. Mason is a good tool but it is not magic and you still need to think about design when you use it. Modules Versus Components This book was written before things like Catalyst MasonX WebApp and MasonX Interp WithCallbacks were available or widely used. The latter two modules were written to make it easier to move application logic out of components into modules. Catalyst is a full-featured framework which makes it easy to build a nicely architected MVC web application. You can use Mason as the templating piece the view with Catalyst quite easily and you re encouraged to check it out at http . Mason is a powerful tool for generating content. Its combination of easy templating syntax powerful component structures and features like autohandlers dhandlers and component inheritance all combine to make it much like Perl itself it makes easy things easy and difficult things possible. However exactly like Perl itself the facilities it provides can make it all too tempting to do things the easy way and Mason makes no attempt to enforce any sort of discipline in your design. Instead this is your responsibility as a programmer and application designer. This is where the responsibility always lies no matter what language or tool you are using. Though Mason is at its core a text templating tool it also provides much more functionality. One such piece of functionality is that individual components are almost exactly like subroutines. They can be called anywhere in your processing and they can in turn call other components generate output and or return values to the caller. And like Perl s subroutines variables defined inside a component are lexically scoped to that component. It is this similarity between components and subroutines that can lead to design trouble. As long-time Mason users we have come to

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.