230 likes | 318 Views
Explore how the Observer Pattern is applied in a weather monitoring system to automatically update three types of displays with new data. Learn about the drawbacks of condiment price changes, introducing new condiments and beverages, and accommodating customer requests in the Starbuzz Coffee case study.
E N D
Design patterns Phần 2
measurementsChanged() đượcgọimỗikhicódữliệumới. (khôngquantâmnóđượcgọinhưthếnàovàaigọi) • Cầncài 3 loại display, chúngphảiđượccậpnhậttựđộngmỗikhicódữliệumới • Hệthốngcầnmởrộngđượcchocácloại display mới
Mẫu Observer ápdụngcácnguyêntắcthiếtkếnhưthếnào? Bàitậpvềnhà
Nhượcđiểm?? • Giá condiment thayđổi • Condiment mới? • Loại beverage mới? • Kháchhàngmuốn double cream ? • …?