TAILIEUCHUNG - Interface-Oriented Design phần 4

Sticks cùng nhau? Tôi đã có một giáo sư tâm lý học cho kỳ thi được thiết kế để làm cho bạn không. Ông sẽ cung cấp cho bốn điều khoản và đặt câu hỏi, làm thế nào nhiều người trong số này đi cùng nhau? Vâng, tất cả phụ thuộc vào cách bạn giải thích thu thập tất cả các kỳ thi "đi cùng nhau.", Vì vậy tôi không có một ví dụ. | You can find commonness in almost anything. For example Why is a lightbulb like Doonesbury Neither one can whistle. We re going to look at the interface to a printer to demonstrate a range of cohesiveness. Depending on your point of view you might consider that all printer operations belong in one interface since they are all related to printing. Or you might consider a narrower view of cohesiveness that divides the operations into multiple A Printer Interface You have a number of different printers in your office each of them has different capabilities. Let s create a spreadsheet that shows the different features for each printer. You probably can think of many more capabilities but we need to have the table fit onto a single printed page. In Figure on the next page a check mark indicates that a printer performs a particular operation. Suppose you were to create your own printing subsystem. The question is how do you place these capabilities into interfaces Do you have a single interface or multiple ones You need to determine which capabilities are available when printing a page. For example if the printer has the capability to turn over the page you want to ask the user whether 3For a look at eight kinds of cohesion from Functional Cohesion to Coincidental see http SDO SDO . A Printer Interface 55 Function Printer print_ text eject_ page print_ color_ image print_ bw_ image turn_ over_ page which_ side_are_ you_on get_ trays select_ tray print_ postscript print_ pclt Modell Model2 Model3 Model4 Figure Printer feature matrix they want double sided printing. If it has the capability to print a black-and-white image but not a color one you may want to convert a color image to black and white before printing it. You could place methods for all these operations into a single interface. Every printer has methods for all operations but a method does nothing for an operation that the printer does not perform. If the

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.