Pattern Categories We distinguish architectural patterns design patterns

  • Slides: 25
Download presentation

Pattern Categories • We distinguish architectural patterns, design patterns and idioms. All three categories

Pattern Categories • We distinguish architectural patterns, design patterns and idioms. All three categories are related to important phases and activities in software development: – Architectural patterns can be used at the beginning of coarsegrained design, when specifying the fundamental structure of an application. – Design patterns are applicable towards the end of coarse-grained design, when refining and extending the fundamental architecture of a software system. – Idioms are used in the implementation phase to transform a software architecture into a program written in a specific language.

Pattern Categories • We distinguish architectural patterns, design patterns and idioms. All three categories

Pattern Categories • We distinguish architectural patterns, design patterns and idioms. All three categories are related to important phases and activities in software development: – Architectural patterns can be used at the beginning of coarsegrained design, when specifying the fundamental structure of an application. – Design patterns are applicable towards the end of coarse-grained design, when refining and extending the fundamental architecture of a software system. – Idioms are used in the implementation phase to transform a software architecture into a program written in a specific language.

Problem Categories(1/3) • Our second classification criterion provides a problemoriented view of a pattern

Problem Categories(1/3) • Our second classification criterion provides a problemoriented view of a pattern system. We define the following problem categories: – From Mud to Structure includes patterns that support a suitable decomposition of an overall system task into cooperating subtasks. – Distributed Systems includes patterns that provide infrastructures for systems that have components located in different processes or in several subsystems and components. – Interactive Systems includes patterns that help to structure systems with human-computer interaction.

Problem Categories(2/3) l l Adaptable Systems includes patterns that provide infrastructures for the extension

Problem Categories(2/3) l l Adaptable Systems includes patterns that provide infrastructures for the extension and adaptation of applications in response to evolving and changing functional requirements. Structural Decomposition includes patterns that support a suitable decomposition of subsystems and complex components into cooperating parts. Organization of Work includes patterns that define how components collaborate to provide a complex service. Access Control includes patterns that guard and control access to services or components.

Problem Categories(3/3) l l l Management includes patterns for handling homogenous collections of objects,

Problem Categories(3/3) l l l Management includes patterns for handling homogenous collections of objects, services and components in their entirety. Communication includes patterns that help to organize communication between components. Resource Handling includes patterns that help to manage shared components and objects.

Comparison l The Gang-of-Four's schema has two dimensions: purpose and scope. The following paragraphs

Comparison l The Gang-of-Four's schema has two dimensions: purpose and scope. The following paragraphs are an excerpt from the Gang-of-Four book. – – The first criterion, called purpose. reflects what a pattern does. The second criterion, called scope, specifies whether the pattern applies primarily to classes or to objects.

5. 3 Pattern Selection(1/3) • selecting a specific pattern includes seven steps: – –

5. 3 Pattern Selection(1/3) • selecting a specific pattern includes seven steps: – – – 1. Specify the problem. Describe each subproblem and its forces separately. For each subproblem, try to find a pattern that helps to solve it. 2. Select the pattern category that corresponds to the design activity you are performing. 3. Select the problem category that corresponds to the general nature of the design problem. Every problem category broadly summarizes the types of problems addressed by the patterns it contains.

5. 3 Pattern Selection(2/3) – – 4. Compare the problem descriptions. Each pattern in

5. 3 Pattern Selection(2/3) – – 4. Compare the problem descriptions. Each pattern in your selected problem category may address a particular aspect of your concrete problem, and either a single pattern or a combination of several can help to solve it. Select the patterns whose problem descriptions and forces best match your design problem. 5. Compare benefits and liabilities. This step investigates the consequences of applying the patterns selected so far. Pick the pattern that provides the benefits you need and whose liabilities are of least concern to you.

5. 3 Pattern Selection(3/3) – – 6. Select the variant that best implements the

5. 3 Pattern Selection(3/3) – – 6. Select the variant that best implements the solution to your design problem. 7. Select an alternative problem category. If there is no appropriate problem category, or if the selected problem category does not include patterns you can use, try to select a problem category that further generalizes your design problem. This category may include patterns that, when specialized, can help you to solve the problem. Then return to step 4, Compare the problem descriptions.

5. 5 The Evolution of Pattern Systems l Even the most mature pattern systems

5. 5 The Evolution of Pattern Systems l Even the most mature pattern systems will not remain static. Knowledge evolves over time-new technologies are developed and existing technologies are enhanced or become outdated. – – New patterns will therefore emerge and existing patterns may 'die'. Every new pattern to emerge must be integrated into the pattern system to keep it up-to-date. Outdated patterns must be removed if they are no longer used. Individual pattern descriptions will change over time-specific aspects will be clarified and further known uses added. Whenever a new pattern is integrated into the system, or an existing pattern is removed, the relationships between existing patterns must be updated.

Extending the Organization Schema • New problem categories are necessary to extend our pattern

Extending the Organization Schema • New problem categories are necessary to extend our pattern system with the patterns from – Creation includes patterns that help with instantiating objects and recursive object structures. – Service Variation comprises patterns that support changing the behavior of an object or component. – Service Extension includes patterns that help to add new services to an object or object structure dynamically. – Adaptation provides patterns that help with interface and data conversion.

Q. 1 Define software architectural style. Q. 2 What is a business archetype? Give

Q. 1 Define software architectural style. Q. 2 What is a business archetype? Give an example. Q. 3 Write a short note on component and connector styles with examples. Q. 4 Differentiate between patterns and frameworks. Q. 5 Describe and compare the four views of software architecture. Q. 6 Compare service variation patterns and service extension patterns with suitable examples. Q. 7 How design patterns differ from architectural patterns? Q. 8 Discuss different types of Enterprise Application Interface (EAI) with suitable examples. Q. 9 Describe any two patterns for interactive software systems. Q. 10 Describe a design pattern that helps to protect access to a particular component. Q. 11 Write short note on Architectural Business Cycle. Q. 12 State the intent of master slave design pattern. Q. 13 What are Software Architecture requirements? Explain four software elements in short? Q. 14 Explain software interface documentation with examples. Q. 15 Discuss the benefits and drawbacks of layering technique in software design. Q. 16 Explain Software Structures and Views? Q. 17 What are creational patterns? Q. 18 Illustrate with example, how Customer Relationship Management (CRM) archetype patterns meet the goals of CRM? Q. 19 What is UML? Explain Module views of UML. Q. 20 Define software architecture? How it relates to the various tasks in software development? Q. 21 Explain with example, how patterns can be used to optimize resource management? Q. 22 What is software configuration management? List and discuss the key functions of the configuration management process. Q. 23 Q. 24 What is risk management? Discuss risk identification, risk monitoring and risk mitigation with an example. Q. 25 What is quality attribute And What are Different types of it? Q. 26 What documentation would you need to do performance Analysis of an Architecture? Q. 27 Define EAI and explain in details. Q. 28 What is a test case? Explain with an example. Q. 29 Compare & Contrast and also give relationship between requirements and design. Illustrate with example. Q. 30 Explain: Architecture is the vehicle for stakeholder communication. Q. 31 How are infrastructure pr ojects different from software projects? Discuss. Q. 32 Explain with a neat diagram, the dynamic scenario of passive filters. Q. 33 Distinguish between availability and modifiability scenarios. Q. 34 Explain the dynamic behaviour of MVC pattern, with sketc hes. Q. 35 What are milestones? Why are they important? Q. 36 Explain various types of dependencies that one module can have on another. Q. 37 State and explain the need for walkthroughs and inspections. Q. 38 State the major impact of design defects. Q. 39 Define and explain software quality assurance. Q. 40 Explain how transactional middleware assist in solving the EAI problem.

 • Examples…. .

• Examples…. .

Why catalog/learn design patterns? • Provides (an application-independent) vocabulary to communicate, document, and explore

Why catalog/learn design patterns? • Provides (an application-independent) vocabulary to communicate, document, and explore design alternatives. • Captures the experience of an expert (especially the rationale behind a design and the trade-offs involved) and codifies it in a form that is potentially “reusable”. • What, why, how, … b. Example is not another way to teach, it is the only way to teach. -- Albert Einstein » (Cf. Vince Lombardi Quote) ceg 860 (Prasad) L 156 DP 18

Example : The Intermediary Pattern • A client interacts with an intermediary while the

Example : The Intermediary Pattern • A client interacts with an intermediary while the requested services are really carried out by the server/worker. 8 Proxy • Intermediary acts like a transmission agent. • E. g. , rpc rmi implementations. Client ceg 860 (Prasad) Proxy L 156 DP Server 19

8 Translator/Adapter • Intermediary acts like a translator between the client and the server.

8 Translator/Adapter • Intermediary acts like a translator between the client and the server. • E. g. , Format/protocol conversions. Client ceg 860 (Prasad) Adapter L 156 DP Server 20

8 Facade • Intermediary acts like a focal point distributing work to other agents.

8 Facade • Intermediary acts like a focal point distributing work to other agents. • E. g. , telnet, ftp, … --> web-browser. • E. g. , local/network files, devices, . . . -> UNIX files Server 1 Client Facade Server 2 Server 3 ceg 860 (Prasad) L 156 DP 21

8 Bridge/Abstract Factory/Handle • Intermediary defines the interface but not the implementation. • E.

8 Bridge/Abstract Factory/Handle • Intermediary defines the interface but not the implementation. • E. g. , Motif/Mac/Windows look and feel. • E. g. , java. io. Input. Stream, java. io. Output. Stream. Impl 1 Client Bridge Impl 2 Impl 3 ceg 860 (Prasad) L 156 DP 22

Example : The Traversal Pattern • Task - Visit every element in an aggregate

Example : The Traversal Pattern • Task - Visit every element in an aggregate structure in a well-defined order and perform an action on each element. 8 Iterator • Defines a mechanism for enumerating elements of an aggregate without exposing the representation (by supporting first(), next(), item(), is. Done(), etc. ) • E. g. , (pre-, in-) post-order traversals of tree. (Cf. Higher-order functions in Scheme. ) ceg 860 (Prasad) L 156 DP 23

 • http: //www. go 4 expert. com/articles/designpattern-simple-examples-t 5127/#abfactory • http: //www. oodesign. com/

• http: //www. go 4 expert. com/articles/designpattern-simple-examples-t 5127/#abfactory • http: //www. oodesign. com/