Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPSC 872 John D. McGregor Session 21 Architecture Design, cont’d.

Similar presentations


Presentation on theme: "CPSC 872 John D. McGregor Session 21 Architecture Design, cont’d."— Presentation transcript:

1 CPSC 872 John D. McGregor Session 21 Architecture Design, cont’d

2 Specification and design problem solution specification implementation specification

3 Styles http://msdn.microsoft.com/en- us/library/ee658117.aspx http://msdn.microsoft.com/en- us/library/ee658117.aspx Pipeline style – http://msdn.microsoft.com/en- us/library/ff963548.aspx http://msdn.microsoft.com/en- us/library/ff963548.aspx Layered style

4 Styles – 2: Control Loop

5 Closed loop control style Monitors fluctuating variable Takes action when violates boundary Sensitivity of thermostat

6 Design Patterns Singleton – http://www.tutorialspoint.com/design_pattern/si ngleton_pattern.htm http://www.tutorialspoint.com/design_pattern/si ngleton_pattern.htm Observer – http://www.tutorialspoint.com/design_pattern/o bserver_pattern.htm http://www.tutorialspoint.com/design_pattern/o bserver_pattern.htm

7 Pattern Pattern Name (Scope, Purpose) Intent Also Known As Motivation Applicability Structure Participants Collaborations Consequences Implementation An implementation Sample Code and Usage Program Listing Known Uses Examples of the pattern found in real systems. Related Patterns

8 Language Idioms class Person { String name; int birthYear; byte[] raw; public boolean equals(Object obj) { if (!obj instanceof Person) return false; Person other = (Person)obj; return name.equals(other.name) && birthYear == other.birthYear && Arrays.equals(raw, other.raw); }

9 Stream manipulation public interface InputStreamAction { void useStream(InputStream stream) throws IOException; } // Somewhere else public void executeWithFile(String filename, InputStreamAction action) throws IOException { InputStream stream = new FileInputStream(filename); try { action.useStream(stream); } finally { stream.close(); } }

10 Putting it all together Identify quality attributes that are important Prioritize them Select patterns that will enhance the most important quality attribute Refactor Repeat with next most important QA

11 Running example The system architecture looks like: Car OBD Phone Cloud


Download ppt "CPSC 872 John D. McGregor Session 21 Architecture Design, cont’d."

Similar presentations


Ads by Google