Prototype Pattern Tutorial Written Date : September 30, 2009

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

Strategy Pattern Tutorial Written Date : October 27, 2009

Visitor Pattern Tutorial Written Date : October 28, 2009

Interpreter Pattern Tutorial Written Date : October 14, 2009

Factory Method Pattern Tutorial Written Date : September 28, 2009

Bridge Pattern Tutorial Written Date : October 8, 2009

Builder Pattern Tutorial Written Date : September 28, 2009

Composite Pattern Tutorial Written Date : October 7, 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 Draw Wireframe for Android Apps? Written Date : February 3, 2016

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

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

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

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

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

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

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

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

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

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

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

Reverse engineering UML classes from source files

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

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

Visual Paradigm Quick Start

Communicate Software Design using PostMania Written Date : August 24, 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

Apply a Design Pattern

Lesson 5: Creating Heterogeneous Parts

Creating a Crosstab Query in Design View

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

Tutorial 1. Creating a Database

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

Intro to MS Visual C++ Debugging

Acrobat 6.0 Standard - Basic Tasks

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

Microsoft Visio 2010

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

Scenario Step-by-Step Guide

Generating/Updating code from whole project

Customizing the Altium Designer Resources

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

7 The Integrated Debugger

Organize Mail into Folders

Viewer. Quick Reference Guide

Introduction to Microsoft Word

SharePoint AD Administration Tutorial for SharePoint 2007

1. In Outlook click on the blue (2013) or yellow (2010) File tab in the top left corner of the window. 2. Click on + Add Account

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

Generating/Updating code from whole project

Starting Excel application

Click the buttons in the interactive below to become familiar with the drawing tool's commands.

Access Review. 4. Save the table by clicking the Save icon in the Quick Access Toolbar or by pulling

Tutorial: Introduction to Flow Graph

Since you can designate as many symbols as needed as baseline symbols it s possible to show multiple baselines with unique symbology.

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

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

Creating a Text Frame. Create a Table and Type Text. Pointer Tool Text Tool Table Tool Word Art Tool

Changing Button Images in Microsoft Office

Using Microsoft Word's "track changes" editing feature: a short guide for authors and editors

TUTORIAL TO CREATE AOI POLYGONS IN GOOGLE EARTH PRO

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

ekaizen Lessons Table of Contents 1. ebook Basics 1 2. Create a new ebook Make Changes to the ebook Populate the ebook 41

EXCEL IMPORT user guide

Power Point 2000 Level 1

Android Tablet Wireframes Written Date : August 29, 2016

Mend for Eclipse quick start guide local analysis

Tutorial 2. Building a Database and Defining Table Relationships

Microsoft Access 2010

Custom Components for Precast Concrete Tekla Structures 12.0 Basic Training September 19, 2006

Fireworks 3 Animation and Rollovers

OrgPublisher Advanced Box Layout Editor

ClickFORMS Quick Start Guide

Autodesk Moldflow Insight AMI Getting Started Tutorial

QUERY USER MANUAL Chapter 7

Modification of an Existing Workflow

Drawing Tools. Drawing a Rectangle

How to Remove Duplicate Rows in Excel

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

Using the Customize Dialog Box

Creating Entity Relationship Diagram

OrgPublisher Cross Browser Planning User Guide

Microsoft Access 2013

Introduction. Creating a New Publication. Publisher 2010 Creating a New Publication. To Create a New Publication from a Template: Page 1

Creating BPMN Business Process Diagram. Assigning IDs to model elements

Concrete Starter Pack User Guide

4 Tutorial: TTCN Suite

TYPE EDIT V12. Tutorial 03. Multicopy to create a set of medals COPYRIGHT 2014 GRAVOTECH MARKING SAS ALL RIGHTS RESERVED

Miami s Quick Start Guide for Using. Snap 9 Professional. to Create a Paper Keyed Survey. Miami s Survey Solutions

Enjoy upgrading to Microsoft Word Author: Christine Kent. Web address Blog address

Setup Guide September 2013

Transcription:

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

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

10. Move the mouse cursor over the Prototype class, and drag out Generalization > Class to create a subclass ConcretePrototype. 11. Make ConcretePrototype inherit the abstract operations provided from Prototype by right clicking on ConcretePrototype, and selecting Related Elements > Realize all Interfaces from the popup menu. https://www.visual-paradigm.com/tutorials/prototypepattern.jsp Page 3 of 11

12. In practice, there may be multiple ConcretePrototype classes. To represent this, stereotype the ConcretePrototype class as PTN Cloneable. Right click on ConcretePrototype class and select Stereotypes > Stereotypes... from the popup menu. https://www.visual-paradigm.com/tutorials/prototypepattern.jsp Page 4 of 11

13. In the Stereotypes tab of class specification, select PTN Cloneable and click > to assign it to the class. Click OK to confirm. The diagram should look like this: Defining Pattern https://www.visual-paradigm.com/tutorials/prototypepattern.jsp Page 5 of 11

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/prototypepattern.jsp Page 6 of 11

3. In the Define Design Pattern dialog box, specify the pattern name Prototype. Keep the file name as it. Click OK to proceed. Applying Design Pattern on Class Diagram In this section, we will try to make use of the prototype pattern to model a part of diagram editor. 1. Create a new project My Diagram Tool. 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/prototypepattern.jsp Page 7 of 11

4. In the Design Pattern dialog box, select Prototype from the list of patterns. 5. Click on Client in the overview. https://www.visual-paradigm.com/tutorials/prototypepattern.jsp Page 8 of 11

6. Rename it to EditTool at the bottom pane. 7. Rename Operation to Duplicate. 8. Select Prototype in overview. 9. Rename Prototype to Shape at the bottom pane, and rename the operation Clone to Duplicate. 10. Select ConcretePrototype in overview. https://www.visual-paradigm.com/tutorials/prototypepattern.jsp Page 9 of 11

11. Rename ConcretePrototype to OvalShape at the bottom pane, and rename the operation Clone to duplicate. 12. We need to have two more concrete prototype classes for square and triangle. Keep ConcretePrototype selecting, click the + button, and select Clone... from the popup menu. 13. Enter 2 to be the number of classes to clone. https://www.visual-paradigm.com/tutorials/prototypepattern.jsp Page 10 of 11

14. Rename ConcretePrototype2 and ConcretePrototype3 to Square and Triangle respectively. Rename the two Clone operations to duplicate. 15. Click OK to confirm editing and apply the pattern to diagram. 16. Tidy up the diagram. It should become: Resources 1. Design Patterns.vpp 2. Prototype.pat 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/prototypepattern.jsp Page 11 of 11