1 / 26

Design Patterns

Design Patterns. Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design. Summary Slide. Importance of Design Patterns Basic Design Patterns Designing Enterprise-level Systems Differences between client/server and Internet systems UML Notation for Deployment Diagrams

Télécharger la présentation

Design Patterns

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Design Patterns Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design

  2. Summary Slide • Importance of Design Patterns • Basic Design Patterns • Designing Enterprise-level Systems • Differences between client/server and Internet systems • UML Notation for Deployment Diagrams • Simple Internet Architecture • Two-layer Architecture • Three-layer Architecture • Web Services

  3. Importance of Design Patterns • Standard design templates can speed OO design • Patterns can exist at different levels of abstraction • At the most concrete level, a class definition with code • At the most abstract level, an approach to a problem • Patterns should contain five main elements • Pattern name, problem, solution, example, benefits and consequences

  4. Pattern description for the controller pattern

  5. Basic Design Patterns • The authors of Elements of Reusable Object-Oriented Software (referred to as the Gang of Four) developed a basic classification scheme for patterns • The 23 GoF patterns are some of the most fundamental and important patterns in use • Scores of other patterns have been defined • For example, both Java and .NET have sets of enterprise patterns

  6. Singleton Pattern • For classes that must have only one instance, but need to be invoked from several classes and locations within the system • The class itself controls the creation of only one instance • A static variable of the class refers to the object that is created • A class method instantiates the object on the first call, and returns a reference to the object on subsequent calls

  7. Singleton pattern template

  8. Adaptor Pattern • Plugs an external class into a system • Converts the method calls from within the system to match the method names in the external class • A standard solution for protection from variations • Insulates the system from frequently changing classes • An interface is frequently used to specify and enforce the use of correct method names

  9. Adapter pattern template

  10. Observer pattern • Used to handle event-processing and reduce coupling • The domain class • Allows other classes to “subscribe” as listeners • “Publishes” the changes to the listeners • The windows class • Sends a reference of itself to subscribe as a listener • Implements the method to be invoked when notified Inherits the method from the listener interface

  11. Figure 9-11 Three classes in the Create new order use case

  12. Figure 9-12 Implementation of the observer pattern

  13. Observer pattern template

  14. Designing Enterprise-level Systems • Enterprise-level systems share components among multiple people or groups in an organization • Enterprise-level systems almost always use multiple tiers of computers • Can be client/server network-based or Internet based • Designed with deployment diagrams • A type of implementation diagram that shows physical components across different locations

  15. Differences between client/server and Internet systems

  16. UML Notation for Deployment Diagrams • Component • Executable module or program • Has an application program interface (API) that is available to the outside world • Node • A physical entity at a specific location • Frameset • A high-level object that holds items to be displayed by a browser

  17. UML component notation

  18. UML node notation UML extension for frameset

  19. Simple Internet Architecture • Used for viewing static information • The browser component executes on the client computer • The Internet server component executes on the server computer • Pages reside on the server and are sent to the browser for display • Program logic is inserted through scripting languages, applets, or other controls

  20. Simple Internet architecture

  21. Two-layer Architecture • Primarily captures information from the user and updates the database • The domain layer and data access layer are usually combined • Input data is sent to a CGI or an application server • The user-interface classes often contain the business logic and data access • Processing takes place with servlets (Java) or code behind classes (.NET)

  22. Two-layer Internet architecture

  23. Three-layer Architecture • Separates domain layer and data access layers • Necessary for systems with complex business logic or multiple user interfaces • Using CGI • Provide a use case controller for each form • Using an application server • Java tools: Java Server Pages and servlets • .NET tools: Common Runtime Language and code behind classes

  24. Three-layer Internet architecture

  25. Web Services • A program that provides a service via the Internet • The service is posted in a directory so that systems can find it • Requests for information go to the UDDI directory • UDDI provides the Internet address of a program offering that service • The application then requests the information • All communication is based on XML to allow for generic data exchange

  26. Invoking a Web service

More Related