✮ ✱ ✼ ✦ ✯ ✪ ✰ ✲ ✩ ✴ ✯ ✶ ✥ ✽ ✴✥ ✦ ✰ ✪ ✽ ★ ✼ ✴ ✶ ✦ ✪ ✹ ✩ ✩ ✯ ✪ ✸ ✶ ✩ ✦ ✰ ✖ ✻ ✬ ★ ✱ ✩ ✸ ✦ ✹✦ ✩ ✺ ✱ ✼ ✬ ✖ ✏ ✍✑ ✒ ✑ ✓ ☛ ☛ ✔ ✕ ✖ ✍ ✗ ✗ ✘ ✚ ✝ ✘ ✛ ✂ ✄ ✎ ✌ ✦ ✆ ✰ ✚✜ ✘ ✂ � ✁ ✂ ✄ ✄☎ ✝ ☞ ✞ ☎ ✟ ✠ ✄ ✡ ✝ ✟ ☛ ✮ ✩ ✝ ✔ ✎ ✏ ✍ �✑ � ✒ ☛ ☛ ✓ ✕ ✌ ✕ ✖ ✖ ✗ ✙ ✝ ✗ ✚ ✂ ✍ ☞ ✄☎ ✄☎ ✑ ✒ ✑ ✚ ✝ � ✁ ✂ ✄ ✆ ☛ ✝ ✞ ☎ ✟ ✠ ✄ ✡ ✝ ✟ ✄ ✝ ✪ ✰ ✬ ✮ ✯ ✦ ✮✰ ✱ ✫ ✯ ✪ ✲ ✪ ✳ ✴ ✦ ✯ ✦ ✵ ✶ ✮ ✷ ✫ ✩ ✂ � ✗ ✙✛ ✕ ✜ ✙ ✟ ✝ ✙ �✑ ✄☎ ★ ✟ ✚ ✢ ✣ ✤ ✥ ✦ Review of Quality Attributes • Recall CISC 323 – Requirements analysis determines desired quality Intro to Software Engineering attributes of system – When designing system, attempt to Week 6: Design Patterns – Some attributes amenable to mathematical expression (performance, availability), others less so (modifiability) Example Quality Attributes • Performance CISC 323 • Availability Intro to Software Engineering • Security • Modifiability Lecture 6-1 • Usability Introduction to Design Patterns • Testability
� ✚ ✑ ✓ ☛ ☛ ✔ ✕ ✖ ✖ ✗ ✗ ✘ ✝ ✍✑ ✘ ✛ ✂ ✄ ✄☎ ✝ ✂ ✘ ✚✜ ✖ ✢ ✚ ✒ ✏ ✝ ✆ ✚ ✑ ✒ ✑ ✑ ✁ � ✁ ✂ ✄ ✄☎ ✝ ✎ ✞ ☎ ✟ ✠ ✄ ✡ ✝ ✟ ☛ ☞ ✌ ✍ ✟ ✚ ✟ ✂ ✔ ✕ ✖ ✖ ✗ ✗ ✘ ✚ ✝ ✘ ✛ ✄ ☛ ✄☎ ✝ ✂ ✘ ✚✜ ✖ ✢ ✚ ✟ ✝ ✚ ✑ ☛ ✓ ✑ ✟ ✒ ✑ � ✁ ✂ ✄ ✄☎ ✆ ✝ ✞ ☎ ✠ ✑ ✄ ✡ ✝ ✟ ☛ ☞ ✌ ✍ ✎ ✏ ✍✑ ✒ ✝ ✒ ✚ ✍ ☛ ☛ ✓ ✑ ✢ ✒ ✍✑ ✏ ✎ ✌ ✕ ☞ ☛ ✟ ✝ ✡ ✄ ✠ ✟ � ✁ ✔ ✖ ✄ ✝ ✄☎ ✝ ✂ ✘ ✚✜ ✖ ✢ ✚ ✟ ✚ ✖ ✑ ✒ ✑ ✛ ✘ ✝ ✚ ✘ ✗ ✗ ✂ ✄☎ ✂ ✞ ✗ ✘ ✚ ✝ ✘ ✛ ✂ ✄ ☎ ✝ ✖ ✄☎ ✆ ✄☎ ✄ ✂ ✝ ✂ ✘ ✚✜ ✖ ✗ ✖ ✆ ☞ ✝ ✞ ☎ ✟ ✠ ✄ ✡ ✝ ✟ ☛ ✌ ✕ ✍ ✎ ✏ ✍✑ ✒ ✑ ✓ ☛ ☛ ✔ ✄ Design Choices Trade Off Design Patterns Quality Attributes • E.g., to obtain performance, may need to use • A design pattern is a set of rules of how to a very complex algorithm, reducing structure code in order to solve a particular modifiability class of problem • E.g., to obtain availability, may need to • Provides vocabulary to discuss design replicate data sources, reducing security • Particularly suited to OO design as patterns • Therefore, design choices rely on knowing can be expressed in terms of classes, required targets for quality attributes associations – At what point is security sufficient? • Design patterns normally help in improving at – At what point is system sufficiently fast? least one quality attribute, perhaps at the expense of others – … Etc. Example: the Publish and Design Patterns Subscribe Design Pattern • Software architecture normally covers the • Problem large-scale design of software systems – A data source is shared by a number of clients – Multiple clients depend on the value of the data • Within architectural components, it can be source useful to apply micro-architectures to help – Modifiability attribute important design these components – Sometimes called design patterns
� ✓ ✗ ✗ ✖ ✖ ✕ ✔ ☛ ☛ ✑ ✚ ✒ ✍✑ ✏ ✎ ✍ ✌ ☞ ☛ ✘ ✝ ✝ ✢ � ✑ ✒ ✑ ✚ ✝ ✟ ✚ ✖ ✘ ✚✜ ✘ ✂ ✝ ✄☎ ✄ ✂ ✛ ✟ ✡ ✂ ✝ ✘ ✂ ✝ ✄☎ ✁ ✂ ✛ ✘ ✚ ✖ ✘ ✗ ✗ ✖ ✖ ✕ ✔ ☛ ✚✜ ✢ ✄ ✂ ✠ ✟ ☎ ✞ ✝ ✆ ✄☎ ✄ ✁ ✚ ✒ � ✑ ✒ ✑ ✚ ✝ ✟ ✁ ✄ ✓ ✠ ☛ ✕ ✄ ✆ ✖ ✡ ✄ ✡ ✕ ✆ ✏ ✡ ✎ ✂ ✁ � ✄ ☛ ✒ ✞ ✆ ✝ ✙ ☛ ✎ ✘ ✎ ✗ ✕ ✎ ✎ ✗✘ ✓ ✞ ✟ ✌ ✎ ✡ ✟ ✄ ✕ ✖✄ ✆ ☞ ✂ ✏ ✎ ✂ ✍ ✍ ✞ ✌ ☛ ✞ ✡ ✠ ✟ ✄ ✆ ✞ ✝ ✄ ✏ ✟✒ ✌ ✌ ✕ ✂ ✏ ✔ ✄ ✌ ✞ ✓ ✄ ✞ ✒ ✄ ✓ ✡ ☛ ✌ ✄ ✌ ☛ ✄ ✑ ✡ ✌ ☞ ☛ ✒ ✟ ✝ ✄ ✎ ✠ ✟ ☎ ✞ ✝ ✆ ✄☎ ✍ ✏ ✂ ✖ ✘ ✝ ✚ ✘ ✗ ✗ ✖ ✍✑ ✕ ✍ ☛ ☛ ✓ ✑ ✒ ✄ ✁ ✂ ✕ ✚ ✘ ✗ ✗ ✖ ✖ ✔ ✘ ☛ ☛ ✓ ✑ ✒ ✍✑ ✏ ✝ ✛ ✁ ✚ � ✑ ✒ ✑ ✚ ✝ ✟ ✢ ✂ ✖ ✚✜ ✘ ✂ ✝ ✄☎ ✄ ✛ ✔ ✄ ✝ ✞ ✝ ✆ ✄☎ ✄ ✂ � � ✁ ✂ ✄ ✄☎ ✆ ✞ ☎ ☎ ✟ ✠ ✄ ✡ ✝ ✟ ☛ ☞ ✌ ✍ ✎ ✏ ✍✑ ✄☎ ✎ ✟ ✝ ✌ ✟ ✝ ✡ ✄ ✑ ✒ ☛ ✠ ✑ ✚ ☞ ✟ ✚ ✢ ✝ ✂ ✘ ✚✜ ✖ Concrete Example: Expense Dependencies Report Item $US Cost $Cdn Cost Total cost ($Cdn) Exchange Rate Air $670 $670 $US cost of Hotel $980 $1470 hotel depends $US cost of Meals $70 $105 depends meals depends TOTAL $1050 $670 $1245 depends $Cdn cost of hotel $Cdn cost of meals Forms-based interface for calculating expense reports. Concrete Example: Expense Problem Report • When exchange rate modified, must update values of Item $US Cost $Cdn Cost Total cost ($Cdn) all components that depend on it Air $670 $670 Hotel $980 $1470 Meals $70 $105 TOTAL $1050 $670 $1245 Exchange Rate $US cost of hotel depends $US cost of depends meals depends Items depend on value of exchange rate. If exchange rate changes, these values should depends $Cdn cost of change too. hotel $Cdn cost of meals
Recommend
More recommend