Week 9, Day 1 Proxy SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.

Slides:



Advertisements
Similar presentations
SE2811 Week 8 Monday (last drop day) The Command Pattern Lambda Expressions SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr.
Advertisements

SE2811 Week 7, Class 2 The Gang of Four and more … Lab Thursday: Quiz SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder.
Week 8, Class 3: Model-View-Controller Model-View-Controller Why? What? How? Example: Barnyard Simon for the Web Question: Where should we use the command.
Design Patterns: Proxy Jason Jacob. What is a Proxy? A Proxy is basically a representative between the Client and the Component. It gives the Client a.
Design Patterns Part IV (TIC++V2:C10) Yingcai Xiao 10/01/08.
Communication in Distributed Systems –Part 2
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The Proxy Design Pattern (1) –A structural design pattern.
CS2852 Week 8, Class 2 Today Tree terminology Non-Binary and Non-Search Trees Tree Traversals (Remaining slides not yet shown) Tomorrow: Quiz Implementing.
Week 5, Day 3: Observer Today Reducing coupling with the Observer The Observer pattern in Java APIs Posting events to a UI worker thread SE-2811 Slide.
Smart Reference Proxy Provides additional actions whenever an object is referenced (e.g., counting the number of references to the object) Firewall Proxy.
1 The Proxy Design Pattern Problem: Defer the cost of object creation and init. until actually used Applicability (possible contexts): – Virtual Proxy:
SE1011 Week 2, Class 3 Today Compiling and running Another example using Scanner Compile-time and Run-time errors Review for exam SE-1011 Slide design:
CS2852 Week 2, Class 1 Today Generics (Section 051) Big-O runtime analysis Muddiest Point Lab Quiz Includes writing a method from ArrayList class (See.
The Factory Patterns SE-2811 Dr. Mark L. Hornick 1.
The Façade Pattern SE-2811 Dr. Mark L. Hornick 1.
Today Quiz Multithreading Options Qt socket buffers between threads Quiz today & Tuesday in lab SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr.
Week 2, Day 2: The Factory Method Pattern Other good design principles Cohesion vs. Coupling Implementing the Strategy Pattern Changing strategies (behaviors)
Week 6, Class 1 & 2: Decorators Return Exam Questions about lab due tomorrow in class? Threads Locking on null object invokeLater & the squares example.
The Proxy Pattern SE-2811 Dr. Mark L. Hornick 1. The Proxy Pattern has many variations, but in general: The Proxy Pattern uses an proxy object as a surrogate.
Week 9, Class 3: Model-View-Controller Today Happens-Before Adapter and Façade Pattern (high-level) Tuesday: Project code due, 11pm Wednesday: Quiz Choose.
SE3910 Week 1, Class 2 Today – Introductions Safety Review Policy The course Tomorrow Lab 1, S365 (Purchase Beaglebone black kit BEFORE) Thursday Class.
Proxy, Observer, Symbolic Links Rebecca Chernoff.
08 - StructuralCSC4071 Structural Patterns concerned with how classes and objects are composed to form larger structures –Adapter interface converter Bridge.
Structural Patterns1 Nour El Kadri SEG 3202 Software Design and Architecture Notes based on U of T Design Patterns class.
Proxy Design Pattern By:Diksha Agarwal.
The Singleton Pattern SE-2811 Dr. Mark L. Hornick 1.
CS2852 Week 3, Class 2 Today Stacks Queues SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
CS2852 Week 6, Class 1 Today The run-time stack Writing and proving recursive methods SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS2852 Week 5, Class 2 Today Queue Applications Circular Queue Implementation Testing SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS2852 Week 7, Class 1 Today Binary Search Tree Implementing add Implementing find Return Quiz 4 (second attempt) Both sections are graded SE-2811 Slide.
CS 210 Proxy Pattern Nov 16 th, RMI – A quick review A simple, easy to understand tutorial is located here:
Week 7, Day 3 Half-Exam 2 A New Pattern SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
CS2852 Week 6, Class 2 Today Class exercise: Implementing a recursive method Binary Search Trees Tomorrow: Quiz at start of lab Implementing a recursive.
Proxy Pattern. What’s a Proxy? A remote proxy acts as a local representative of a remote object Remote Object: instantiated in a different JVM heap (a.
The Proxy Pattern (Structural) ©SoftMoore ConsultingSlide 1.
CS2910 Week 4, Class 1 Today Encoding in Python – Review Quiz – Encoding in Python Introduction to HTTP SE-2811 Slide design: Dr. Mark L. Hornick Content:
CS2852 Week 3, Class 2 Today Big-O runtime analysis Linked Lists Muddiest Point Lab Quiz Includes writing a method from ArrayList class (See next slide)
CS2852 Week 2, Class 2 Today Big-O runtime analysis Linked Lists Muddiest Point Lab Quiz Includes writing a method from ArrayList class (See next slide)
Week 7, Class 1: The Command Pattern (cont.) Get Ready for Poll Everywhere Labs 2 & 3 returned Lab 7 due this evening at 11pm Quiz tomorrow at start of.
CS2910 Week 4, Class 2 Today Sit by someone you have not yet worked with this quarter. Learn his/her name if unknown. Turn on your laptop and start Wireshark.
CS2910 Week 8, Class 2 Today Return Quiz Look at Schedule TCP implementation! Week 8, Monday Quiz on SMTP May include some questions requiring you to interpret.
Week 10, Day 3 Review for the quarter SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
CS2910 Week 7, Class 1 Today Capturing SMTP with Thunderbird Tomorrow Extra office hour at 11 am (right after lab) Friday Office hour cancelled SE-2811.
CS2910 Week 5, Class 1 Today Sit by someone you have not yet worked with Turn on your laptop and start Wireshark. DNS Next week Monday: Midterm Exam SE-2811.
Software Design and Architecture Muhammad Nasir Structural Design Patterns
Week 6, Class 3: Composite Swing composites File composites Computer composites SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Week 4, Day 1: Singleton(s?) Singleton leftover Why singletons? How to make lazy initialization work multi- threaded? Observers Why observers? Class structure.
Week 5, Class 3: Decorators Lab questions? Example: Starbuzz coffee Basic Pattern More examples Design Principles Compare with alternatives SE-2811 Slide.
CS2910 Week 6, Lab Today Dictionaries in Python SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
SE3910 Week 8, Class 2 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 7, Class 2 (Wednesday) Half-Exam 2 Done.
CS-2852 Data Structures Week 5, Class 3 – Testing and Recursion Queue Implementing finite queues Binary Search Recursion Tomorrow – Quiz, Lab demos, Lab.
Slide design: Dr. Mark L. Hornick
Week 2, Day 1: The Factory Method Pattern
Dynamic Proxy Proxy: Addition to the Java 1.3 reflection package:
Model-View-Controller
Week 7, Class 1: The Command Pattern (cont.)
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Week 8, Class 3: Model-View-Controller
SE-1021 Software Engineering II
Slide design: Dr. Mark L. Hornick
Software Design Lecture : 38.
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
15. Proxy SE2811 Software Component Design
Proxy Pattern Definition of “Proxy”: Authority or power to act for another Original Gang of Four pattern, much used Stands in for a “real object” (similar.
Slide design: Dr. Mark L. Hornick
Presentation transcript:

Week 9, Day 1 Proxy SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1

Simon Concluded Implementing Simon Model Maintaining scores Simon’s count Player’s count View Playing sounds Loading sounds Controller Initiating sounds Playing the sequence SE-2811 Dr.Yoder 2

The Proxy Pattern has many variations, but in general: The Proxy Pattern uses an proxy object as a surrogate (aka stand-in or placeholder) that acts like another object When might you do this? SE-2811 Dr. Mark L. Hornick 3

SE-2811 Dr. Josiah Yoder 4

Generic Proxy Pattern: A Client programs to a Subject, which may be a RealSubject or a Proxy SE-2811 Dr. Mark L. Hornick 5

The Stub Proxy is a (temporary) placeholder for the Real Subject Sometimes the Real Subject is not available For example: still under development The Stub Proxy can provide implementation of the Subject interface to varying degrees: 1. Just enough to compile without error 2. To allow rudimentary Subject functionality 3. To provide a complete emulation of the RealSubject 6

Stub Proxy – the Real Subject emulator SE-2811 Dr. Mark L. Hornick 7

The Protection Proxy controls access to a resource (the Real Subject) that is restricted by access rights The Protection Proxy provides predefined access to certain functionality implemented by the Real Subject, but Purposely limited by the access rights built into the Protection Proxy For example, the ability to query (but not modify) a protected database 8

The Protection Proxy limits access to the Real Subject SE-2811 Dr. Mark L. Hornick 9 ProtectionProxy

The Virtual Proxy controls access to a resource (the Real Subject) that is expensive to create or use The Virtual Proxy provides access to all of the functionality implemented by the Real Subject, but More quicky/cheaply Acts as a surrogate until the Real Subject becomes available 10

The Virtual Proxy provides all functionality of the Real Subject SE-2811 Dr. Mark L. Hornick 11 The Virtual Proxy controls access to the Real Subject, and is often responsible for creation of the Real Subject

The Remote Proxy provides local access to a remote resource (the Real Subject) The Remote Proxy handles the details of accessing a remote resource Remote Access can be implemented in many different ways, using different communication protocols Simple sockets Remote Method Invocation HTTP-based (e.g. web-services) … 12

The Remote Proxy allows the Client to think it is accessing a local resource SE-2811 Dr. Mark L. Hornick 13

SE-2811 Dr. Mark L. Hornick 14