Presentation is loading. Please wait.

Presentation is loading. Please wait.

Design and Programming Patterns Associated with Java Networking by Margaret Toews cs843, Spring 2003.

Similar presentations


Presentation on theme: "Design and Programming Patterns Associated with Java Networking by Margaret Toews cs843, Spring 2003."— Presentation transcript:

1 Design and Programming Patterns Associated with Java Networking by Margaret Toews cs843, Spring 2003

2 Design Patterns History Benefits Description Examples Conclusion

3 Design Patterns – History Late 1970’s, book by Christopher Alexander published, domain – architectural design patterns 1987, OOPSLA conference, paper presented on design patterns in Smalltalk 1995, Design Patterns: Elements of Reusable Object-Oriented Software, published

4 Benefits of Design Patterns Provide a framework for naming solutions – templates provide a framework for description – give developers a vocabulary to use when collaborating Enable developers to document solutions Can build on expertise of others Can use solutions that have worked before –Rule of three

5 Design Pattern Template (GofF) Name Participants Classification Collaborations Intent Consequences Also Known As Implementation Motivation Sample Code Applicability Known Uses Structure Related Patterns

6 Template Attributes Name –Name –Classification –Also Known As (optional) –Intent What does this pattern do? Problem –Motivation A scenario that describes the problem –Applicability

7 Template Attributes (cont) Solution –Structure Can include UML or OMT diagrams –Participants List of classes and objects –Collaborations Other patterns involved –Implementation –Sample Code –Known Uses –Related Patterns

8 Template Attributes (cont) Consequences –Consequences Trade offs – often in flexibility, portability

9 Classification of Design Patterns

10 Problem: High Communication Overhead Solution Request data more efficiently –use Fast Lane Reader Pattern Make fewer remote method calls –use Half-Object Plus Protocol

11 Fast Lane Reader Pattern Motivation –Using EJB to implement a catalog of services for a financial services company –Customer wants to browse list of available online services Problem –High overhead to use EJB for read-only listing Possible solution –Avoid EJB, use direct access

12 Fast Lane Reader Pattern

13 Half-Object Plus Protocol Pattern Motivation –Using RMI to implement a Voting Services application Problem –Part of functionality should execute remotely, part locally Want to avoid using remote method calls for login Possible Solution –Split object and use a proxy to communicate between the two parts

14 Half-Object Plus Protocol

15 Conclusion Design patterns enable developers to build on solutions that have already been created. “Each pattern describes a problem that occurs over and over again in our environment and then describes the core of the solution to that problem in such a way that you can use this solutions a million times over without ever doing it the same way twice.” - Christopher Alexander


Download ppt "Design and Programming Patterns Associated with Java Networking by Margaret Toews cs843, Spring 2003."

Similar presentations


Ads by Google