Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Similar pattern among "most-efficient" sorting algorithms, Recursive Divide list into smaller lists Then recursively sort smaller lists. Recombine two sorted lists obtaining one final sorted list | Chapter 20 Patterns and UML Learning Objectives Patterns Adapter pattern Model-View-Controller pattern Sorting pattern and it’s efficiency Pattern formalism UML History of UML UML class diagrams Class interactions Introduction Patterns and UML Software design tools Programming-language independent Assuming object-oriented-capable Pattern Like "ordinary" pattern in other contexts An "outline" of software task Can result in different code in different but similar tasks UML Graphical language for OOP design Patterns Patterns are design principles Apply across variety of software applications Must also apply across variety of situations Must make assumptions about application domain Example: Iterator pattern applies to containers of almost any kind Pattern Example: Iterators Recall iterators Iterator pattern applies to containers of almost any kind 1st described as "abstract" As ways of cycling thru any data in any container Then gave specific applications Such as list iterator, . | Chapter 20 Patterns and UML Learning Objectives Patterns Adapter pattern Model-View-Controller pattern Sorting pattern and it’s efficiency Pattern formalism UML History of UML UML class diagrams Class interactions Introduction Patterns and UML Software design tools Programming-language independent Assuming object-oriented-capable Pattern Like "ordinary" pattern in other contexts An "outline" of software task Can result in different code in different but similar tasks UML Graphical language for OOP design Patterns Patterns are design principles Apply across variety of software applications Must also apply across variety of situations Must make assumptions about application domain Example: Iterator pattern applies to containers of almost any kind Pattern Example: Iterators Recall iterators Iterator pattern applies to containers of almost any kind 1st described as "abstract" As ways of cycling thru any data in any container Then gave specific applications Such as list iterator, constant list iterator, reverse list iterator, etc. Consider No Patterns Iterators Imagine huge amount of detail if all container iterators presented separately! If each had different names for begin(), end() To make "sense" of it, learners might make pattern themselves! Until pattern developed, all were different "Seemed" similar, but not organized Consider containers as well Same issues! Adapter Pattern Transforms one class into different class With no changes to underlying class Only "adding" to interface Recall stack and queue template classes Both can choose underlying class used to store data: stack> -- int stack under vector stack> -- int stack underlying list All cases underlying class not changed Only interface is added Adapter Pattern Interface How to add interface? Implementation detail Not part of pattern But two ways: Example: for stack adapter: Underlying container class could be member variable of stack class Or stack class could be derived class .