Transcript
Page 1: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

SWEN 383 Software Design Principles & PatternsThe Proxy Pattern

Page 2: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Basic Proxy

Page 3: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Overview

Joe and Mary want to sign a contract.

Joe is in Canada.

Mary is in Argentina.

Page 4: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Overview

Joe asks Sandy to be a proxy for Mary.

Mary asks Pedro to be a proxy for Joe.

Page 5: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Overview

Joe “agrees with” Sandy as Mary’s stand-in.

Mary “agrees with” Pedro as Joe’s stand-in.

Page 6: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Overview

Joe “agrees with” Sandy as Mary’s stand-in.

Mary “agrees with” Pedro as Joe’s stand-in.

Page 7: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Overview

Joe and Mary now have a legal contract.

Page 8: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Health-care proxy

Joe needs to make health care decisions for

his mother Jane’s surgery.

The had a previous agreement through a

Health-care proxy

Page 9: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Basic Proxy

What is the primary design issue

addressed by the Proxy pattern?

Page 10: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Proxy vs. Adapter

Page 11: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Proxy vs. Adapter

How are proxies and adapters similar?

Page 12: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Proxy vs. Adapter

How are proxies and adapters different?

Page 13: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Virtual Proxy

Page 14: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Virtual Proxy

What is the purpose of a virtual proxy?Lazy Loading..

Page 15: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Page 16: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Remote Proxy

Page 17: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Remote Proxy

What is the purpose of a Remote

proxy?

Page 18: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Remote Proxy

How does a Remote proxy work?

Page 19: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Remote Proxy

How might a remote proxy be used

in a browser that manipulates

information on a web server?

Page 20: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Remote Proxy

How might a remote proxy be used

in a browser that manipulates

information on a web server?

Node A Node B

Page 21: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

A(proxy)

A A B

The MAGIC SAUCE!

Page 22: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Protection Proxy

Page 23: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Page 24: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Protection Proxy

What is the purpose of a protection

proxy?

Page 25: SWEN 383 Software Design Principles & Patterns The Proxy Patternswen-383/slides/instructor-specific/Martinez/Week1… · PowerPoint Presentation Author: Hawker, J. Scott Created Date:

*

Protection Proxy

How could a Protection Proxy be

used to control access to the object

representing a blog article?


Recommended