Bridge Pattern Tutorial Written Date : October 8, 2009

Similar documents
Command Pattern Tutorial Written Date : October 14, 2009

Prototype Pattern Tutorial Written Date : September 30, 2009

Strategy Pattern Tutorial Written Date : October 27, 2009

Interpreter Pattern Tutorial Written Date : October 14, 2009

Visitor Pattern Tutorial Written Date : October 28, 2009

Composite Pattern Tutorial Written Date : October 7, 2009

Builder Pattern Tutorial Written Date : September 28, 2009

Factory Method Pattern Tutorial Written Date : September 28, 2009

Singleton Pattern Tutorial Written Date : September 30, 2009

How to Use Profile Diagram to Manage Stereotypes? Written Date : March 6, 2016

How to Generate Java from UML Class Diagram in NetBeans? Written Date : February 22, 2010

How to Generating DB Specification from Database> Written Date : January 20, 2016

How to Draw Wireframe for Android Apps? Written Date : February 3, 2016

What is Package Diagram? How to Draw Package Diagram? Written Date : July 29, 2014

How to Customize SysML Requirement Types? Written Date : February 4, 2016

Generate Java source from UML class diagram in NetBeans Written Date : February 22, 2010

UML Getting Started - UML Modeling in Eclipse Written Date : March 03, 2016

How to Keep ERD and Data Dictionary Synchronized? Written Date : January 20, 2014

How to Draw UML Sequence Diagram? Written Date : March 16, 2016

How to Draw BPMN 2.0 Business Process Diagram? Written Date : March 9, 2016

What is Storyboard? How to Develop a Storyboard? Written Date : January 20, 2016

How to Customize a RACI Chart? Written Date : February 23, 2016

How to Generate Redshift Database from ERD? Written Date : April 08, 2016

How to Write Effective Use Cases? Written Date : January 27, 2016

How to Capture Ad-Hoc Ideas with Brainstorm Diagram? Written Date : July 08, 2014

ERD Tutorial: How to Design and Generate SQL Server DB? Written Date : June 19, 2015

How to Manage Software Development Process with Tasifier? Written Date : September 10, 2014

What is Data Flow Diagram (DFD)? How to Draw DFD? Written Date : January 27, 2012

How to Gather Requirements with UeXceler? (YouTube Example) Written Date : January 27, 2016

Introduction to BPMN Part III - Flow and Connecting Objects Written Date : March 07, 2016

What is TOGAF? How to Perform EA with TOGAF ADM Tool? Written Date : January 20, 2017

Communicate Software Design using PostMania Written Date : August 24, 2016

4 Tutorial: TTCN Suite

Tutorial 1. Creating a Database

Intro to MS Visual C++ Debugging

SharePoint AD Administration Tutorial for SharePoint 2007

Excel window. This will open the Tools menu. Select. from this list, Figure 3. This will launch a window that

1. Move your mouse to the location you wish text to appear in the document. 2. Click the mouse. The insertion point appears.

Visual Paradigm Quick Start

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011

Reverse engineering UML classes from source files

Tutorial 2. Building a Database and Defining Table Relationships

Our Goals Teaching with Power Point

1. Right-click the worksheet tab you want to rename. The worksheet menu appears. 2. Select Rename.

Generating/Updating code from whole project

Chapter 3 How to use HTML5 and CSS3 with ASP.NET applications

Day : Date : Objects : Open MS Excel program. Subject : * Open Excel application. Select : start. Choose: programs. Choose : Microsoft Office

PM4 + Partners Knowledge Articles

Customizing the Altium Designer Resources

Organize Mail into Folders

Tecniche di Progettazione: Design Patterns

Tutorial. [PROMET + SemTalk]

Document Editor Features Available in HTML5. it just makes sense

1 Overview. 1 Overview. Contents. 1.1 Table of Contents Table of Contents

Join Queries in Cognos Analytics Reporting

Microsoft Office Outlook 2007: Intermediate Course 01 Customizing Outlook

You can make certain sections of the text clickable by creating hyperlinks. Once clicked, these links navigate users to different

What s new in RevMan 5.1. New features and functions in RevMan 5.1

AASHTOWare BrR/BrD 6.8 Reinforced Concrete Structure Tutorial RC1 Single Span Reinforced Concrete Tee Beam Example

Generating/Updating code from whole project

Starting Excel application

Recipes4Success. Create a Storybook. ImageBlender 2.5 Storybook Maker

Student Manual. Cognos Analytics

To complete this project, you will need the following folder:

Apply a Design Pattern

1. Select the Insert tab. 2. Click the Picture command in the Images group. The Insert Picture dialog box appears.

CBCL Limited Tool Palettes Tutorial 2012 REV. 01. CBCL Design Management & Best CAD Practices. Our Vision

Changing Button Images in Microsoft Office

Nauticom NetEditor: A How-to Guide

BRIEFCASES & TASKS ZIMBRA. Briefcase can be used to share and manage documents. Documents can be shared, edited, and created using Briefcases.

Visual Paradigm Doc. Composer Writer s Guide

SalesNet Mailing Labels

Mailing Labels from REARS

ICS Tutorials: Basic Operations

Getting Started. The main tasks described in this section are the following:

EXCEL IMPORT user guide

Android Tablet Wireframes Written Date : August 29, 2016

XML Spy Tutorial Lab Contents

Mend for Eclipse quick start guide local analysis

Microsoft Visio 2010

Microsoft Access 2010

WinSCP. Author A.Kishore/Sachin

Using Windows 7 Explorer By Len Nasman, Bristol Village Computer Club

Crot. Installation instructions & Tutorial. Anti plagiarism solutions. Desktop version. (c) Crot: Anti plagiarism solutions

Using Spreadsheets, Selection Sets, and COGO Controls SPECTRA PRECISION SURVEY OFFICE TUTORIAL

How to Mail Merge PDF Documents

Microsoft Word 2010: Using Mail Merge

IDERA ER/Studio Software Architect Evaluation Guide. Version 16.5/2016+ Published February 2017

Introduction to web page creation

The tutorial has been broken up into step, these are as follows:

In this lab, you will build and execute a simple message flow. A message flow is like a program but is developed using a visual paradigm.

Outlook 2007 Guide. Frequently Asked Questions

Modification of an Existing Workflow

QUERY USER MANUAL Chapter 7

Creating Entity Relationship Diagram

MAIL MERGE LABELS USE THE MAIL MERGE WIZARD

How to Remove Duplicate Rows in Excel

Tutorial: How to draw SUV models with Astah SysML

OpenAmeos tutorial. Contents. Author: Balázs Simon, BME IIT, 2012.

The MVC Design Pattern

Transcription:

Written Date : October 8, 2009 This tutorial is aimed to guide the definition and application of Gang of Four (GoF) bridge design pattern. By reading this tutorial, you will know how to develop a model for the bridge pattern, and how to apply it in practice. Modeling Design Pattern with Class Diagram 1. Create a new project Design Patterns. 2. Create a class diagram Bridge. 3. Select Class from diagram toolbar. Click on the diagram to create a class. Name it as Abstraction. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 1 of 14

4. Right click on Abstraction, and select Model Element Properties > Abstract to set it as abstract. 5. Move the mouse cursor over the Abstraction class, and drag out Aggregation > Class to create an associated class Implementor. 6. Right click on Implementor, and select Model Element Properties > Abstract to set it as abstract. 7. Right click on the Abstract class, and select Add > Operation from the popup menu. 8. Name the operation Operation(). 9. Right click on the Implementor class, and select Add > Operation from the popup menu. Name the operation OperationImpl(). https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 2 of 14

10. Right click on Implementor, and select Model Element Properties > Abstract to set it as abstract. 11. Move the mouse cursor over the Abstraction class, and drag out Generalization > Class to create a subclass RefinedAbstraction. 12. Repeat the previous step to create a subclass ConcreteImplementor from Implementor. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 3 of 14

13. ConcreteImplementor will inherits the operations from Implementor. Right click on ConcreteImplementor and select Related Elements > Realize all Interfaces from the popup menu. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 4 of 14

14. In practice, there may be multiple refined abstractions and/or concrete implementors. To represent this, stereotype the class RefinedAbstraction and ConcreteImplementor as PTN Cloneable. Right click on Abstraction and select Stereotypes > Stereotypes... from the popup menu. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 5 of 14

15. In the Stereotypes tab of the Class Specification dialog box, select PTN Cloneable and click > to assign it to RefinedAbstraction class. Click OK to confirm. 16. Repeat steps 14 and 15 on concreteimplementor. 17. In practice, there may be multiple operations and/or operationimpls. To represent this, stereotype the class Abstraction and Implementor as PTN Members Creatable. Repeat steps 14 and 15 to stereotype Abstraction and Implementor as PTN Members Creatable. Defining Pattern https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 6 of 14

1. Select all classes on the class diagram. 2. Right click on the selection and select Define Design Pattern... from the popup menu. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 7 of 14

3. In the Define Design Pattern dialog box, specify the pattern name Bridge. Keep the file name as is. Click OK to proceed. Applying Design Pattern on Class Diagram In this section, we are going to apply the bridge pattern to model a report generator for various report types. 1. Create a new project Diagram Editor. 2. Create a class diagram Domain Model. 3. Right click on the class diagram and select Utilities > Apply Design Pattern... from the popup menu. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 8 of 14

4. In the Design Pattern dialog box, select Bridge from the list of patterns. 5. Click on Abstraction in the overview. 6. Rename Abstraction to ReportGenerator and operation Operation to generate at the bottom pane. 7. Select RefinedAbstraction in the overview pane. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 9 of 14

8. Rename RefinedAbstraction to HTMLReportGenerator. 9. Besides HTML report generator, we need also a Plain Text report generator. Click on the + button at the bottom pane, beside Abstraction, and select Clone... 10. Enter 1 to be the number of classes to clone. Click OK to confirm. 11. Rename RefinedAbstraction2, the cloned class, to PlainTextReportGenerator. 12. Select Implementor in the overview pane. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 10 of 14

13. Rename Implementor to ReportGeneratorImpl, and OperationImpl to generatetoc. 14. We need 2 more operations for generating content and appendix. Click on the + button and select New Operation... from the popup meun. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 11 of 14

15. In the Operation Specification dialog box, name the operation generatecontent. Check Abstract at the bottom of the dialog box. 16. Repeat the previous steps to create another abstract operation generateappendix. 17. Select ConcreteImplementor in overview. Rename ConcreteImplementor to SimpleReportGeneratorImpl, and operation OperationImpl to generatetoc. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 12 of 14

18. Similar to RefinedAbstraction, here we need to have another concrete implementor for generating complex report. Click on the + button and select Clone... from the popup menu. 19. Enter 1 to be the number of classes to clone. Click OK to confirm. 20. Rename ConcreteImplmentor2, the cloned class, to ComplexReportGeneratorImpl, and operation OperationImpl to generatetoc. 21. Click OK to confirm. Here is the diagram formed: 22. We want HTMLReportGenerator and PlainTextReportGenerator to implement their own way of generating repot. Select the generate operation is ReportGenerator. https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 13 of 14

23. Press the Ctrl key, and drag to HTMLReportGenerator. Replease the mouse button afterwards. 24. Repeat the previous steps to create the generate method in PlainTextReportGenerator. Here is the completed diagram: Resources 1. Bridge.pat 2. Design Patterns.vpp Related Links Full set of UML tools and UML diagrams Visual Paradigm home page (https://www.visual-paradigm.com/) Visual Paradigm tutorials (https://www.visual-paradigm.com/tutorials/) https://www.visual-paradigm.com/tutorials/bridgedesignpattern.jsp Page 14 of 14