objektno orijentisano modelovanje

819
Object-Oriented Model Sybase ® PowerDesigner ® 12.5 Windows

Upload: nikola-nedeljkovic

Post on 07-Nov-2015

42 views

Category:

Documents


1 download

DESCRIPTION

objektno modelovanje

TRANSCRIPT

  • Object-Oriented Model

    Sybase PowerDesigner

    12.5Windows

  • Part number: DC38086-01-1250-01Last modified: April 2007

    Copyright 1991-2007 Sybase, Inc. and its subsidiaries. All rights reserved.

    Information in this manual may change without notice and does not represent a commitment on the part of Sybase, Inc. and its subsidiaries.

    Sybase, Inc. provides the software described in this manual under a Sybase License Agreement. The software may be used only in accordance withthe terms of the agreement.

    No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, orotherwise, without the prior written permission of Sybase, Inc. and its subsidiaries.

    Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for theDOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.

    Sybase, SYBASE (logo), ADA Workbench, Adaptable Windowing Environment, Adaptive Component Architecture, Adaptive Server, AdaptiveServer Anywhere, Adaptive Server Enterprise, Adaptive Server Enterprise Monitor, Adaptive Server Enterprise Replication, Adaptive ServerEverywhere, Advantage Database Server, Afaria, Answers Anywhere, AppModeler, APT Workbench, APT-Build, APT-Edit, APT-Execute,APT-Translator, APT-Library, ASEP, Avaki, Avaki (Arrow Design), Avaki Data Grid, AvantGo, Backup Server, BayCam, Bit-Wise, BizTracker,Certified PowerBuilder Developer, Certified SYBASE Professional, Certified SYBASE Professional Logo, ClearConnect, Client-Library, ClientServices, CodeBank, Column Design, ComponentPack, Connection Manager, Convoy/DM, Copernicus, CSP, Data Pipeline, Data Workbench,DataArchitect, Database Analyzer, DataExpress, DataServer, DataWindow, DataWindow .NET, DB-Library, dbQueue, Dejima, Dejima Direct,Developers Workbench, DirectConnect Anywhere, DirectConnect, Distribution Director, Dynamic Mobility Model, e-ADK, E-Anywhere, e-BizIntegrator, E-Whatever, EC Gateway, ECMAP, ECRTP, eFulfillment Accelerator, EII Plus, Electronic Case Management, Embedded SQL, EMS,Enterprise Application Studio, Enterprise Client/Server, Enterprise Connect, Enterprise Data Studio, Enterprise Manager, Enterprise Portal (logo),Enterprise SQL Server Manager, Enterprise Work Architecture, Enterprise Work Designer, Enterprise Work Modeler, eProcurement Accelerator,eremote, Everything Works Better When Everything Works Together, EWA, ExtendedAssist, Extended Systems, ExtendedView, Financial Fusion,Financial Fusion (and design), Financial Fusion Server, Formula One, Fusion Powered e-Finance, Fusion Powered Financial Destinations, FusionPowered STP, Gateway Manager, GeoPoint, GlobalFIX, iAnywhere, iAnywhere Solutions, ImpactNow, Industry Warehouse Studio, InfoMaker,Information Anywhere, Information Everywhere, InformationConnect, InphoMatch, InstaHelp, Intelligent Self-Care, InternetBuilder, iremote,iScript, Jaguar CTS, jConnect for JDBC, KnowledgeBase, Logical Memory Manager, lrLite, M2M Anywhere, Mach Desktop, Mail AnywhereStudio, Mainframe Connect, Maintenance Express, Manage Anywhere Studio, MAP, M-Business Anywhere, M-Business Channel, M-BusinessNetwork, M-Business Suite, MDI Access Server, MDI Database Gateway, media.splash, Message Anywhere Server, MetaWorks, MethodSet,mFolio, Mirror Activator, ML Query, MobiCATS, Mobil 365, Mobileway, MySupport, Net-Gateway, Net-Library, New Era of Networks, NextGeneration Learning, Next Generation Learning Studio, O DEVICE, OASiS, OASiS logo, ObjectConnect, ObjectCycle, OmniConnect, OmniQ,OmniSQL Access Module, OmniSQL Toolkit, OneBridge, Open Biz, Open Business Interchange, Open Client, Open ClientConnect, OpenClient/Server, Open Client/Server Interfaces, Open Gateway, Open Server, Open ServerConnect, Open Solutions, Optima++, Partnerships thatWork, PB-Gen, PC APT Execute, PC DB-Net, PC Net Library, Pharma Anywhere, PhysicalArchitect, Pocket PowerBuilder, PocketBuilder,Power++, Power Through Knowledge, power.stop, PowerAMC, PowerBuilder, PowerBuilder Foundation Class Library, PowerDesigner,PowerDimensions, PowerDynamo, Powering the New Economy, PowerScript, PowerSite, PowerSocket, Powersoft, PowerStage, PowerStudio,PowerTips, Powersoft Portfolio, Powersoft Professional, PowerWare Desktop, PowerWare Enterprise, ProcessAnalyst, Pylon, Pylon Anywhere,Pylon Application Server, Pylon Conduit, Pylon PIM Server, Pylon Pro, QAnywhere, Rapport, Relational Beans, RepConnector, Report Workbench,Report-Execute, Replication Agent, Replication Driver, Replication Server, Replication Server Manager, Replication Toolkit, Resource Manager,RFID Anywhere, RW-DisplayLib, RW-Library, SAFE, SAFE/PRO, Sales Anywhere, Search Anywhere, SDF, Search Anywhere, Secure SQLServer, Secure SQL Toolset, Security Guardian, ShareSpool, Sharelink SKILS, smart.partners, smart.parts, smart.script, SOA AnywhereTrademark,SQL Advantage, SQL Anywhere, SQL Anywhere Studio, SQL Code Checker, SQL Debug, SQL Edit, SQL Edit/TPU, SQLEverywhere, SQL Modeler, SQL Remote, SQL Server, SQL Server Manager, SQL SMART, SQL Toolset, SQL Server/CFT, SQL Server/DBM,SQL Server SNMP SubAgent, SQL Station, SQLJ, Stage III Engineering, Startup.Com, STEP, SupportNow, S.W.I.F.T. Message Format Libraries,Sybase 365, Sybase Central, Sybase Client/Server Interfaces, Sybase Development Framework, Sybase Financial Server, Sybase Gateways, SybaseIQ, Sybase Learning Connection, Sybase MPP, SyberLearning LIVE, Sybase SQL Desktop, Sybase SQL Lifecycle, Sybase SQL Workgroup,Sybase Synergy Program, Sybase Virtual Server Architecture, Sybase User Workbench, SybaseWare, Syber Financial, SyberAssist, SybFlex,SybMD, SyBooks, System 10, System 11, System XI (logo), SystemTools, Tabular Data Stream, The Enterprise Client/Server Company, TheExtensible Software Platform, The Future Is Wide Open, The Learning Connection, The Model For Client/Server Solutions, The Online InformationCenter, The Power of One, TotalFix, TradeForce, Transact-SQL, Translation Toolkit, Turning Imagination Into Reality, UltraLite, UltraLite.NET,UNIBOM, Unilib, Uninull, Unisep, Unistring, URK Runtime Kit for UniCode, Unwired Accelerator, Unwired Orchestrator,Viafone, Viewer,VisualWriter, VQL, WarehouseArchitect, Warehouse Control Center, Warehouse Studio, Warehouse WORKS, Watcom, Watcom SQL, WatcomSQL Server, Web Deployment Kit, Web.PB, Web.SQL, WebSights, WebViewer, WorkGroup SQL Server, XA-Library, XA-Server, XcelleNet, XPServer, XTNDConnect, and XTNDACCESS are trademarks of Sybase, Inc. or its subsidiaries.

    All other trademarks are the property of their respective owners.

    ii

  • Contents

    I OOM Guide ix

    About This Manual xi

    1 Getting Started with an Object-Oriented Model 1What is an OOM? . . . . . . . . . . . . . . . . . . . . . . . . 2Creating an OOM . . . . . . . . . . . . . . . . . . . . . . . . 6Working with Languages . . . . . . . . . . . . . . . . . . . . . 9

    2 Building Structural Diagrams 13Introducing Structural Diagrams . . . . . . . . . . . . . . . . . 15Class Diagram Basics . . . . . . . . . . . . . . . . . . . . . . 16Composite Structure Diagram Basics . . . . . . . . . . . . . . 19Object Diagram Basics . . . . . . . . . . . . . . . . . . . . . . 22Package Diagram Basics . . . . . . . . . . . . . . . . . . . . 25Classes (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . 27Packages (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . 51Interfaces (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . 55Objects (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . 59Parts (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 65Ports (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 68Attributes (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . 72Identifiers (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . 82Operations (OOM) . . . . . . . . . . . . . . . . . . . . . . . . 86Associations (OOM) . . . . . . . . . . . . . . . . . . . . . . . 102Generalizations (OOM) . . . . . . . . . . . . . . . . . . . . . 115Dependencies (OOM) . . . . . . . . . . . . . . . . . . . . . . 119Realizations (OOM) . . . . . . . . . . . . . . . . . . . . . . . 124Require Links (OOM) . . . . . . . . . . . . . . . . . . . . . . 126Assembly Connectors (OOM) . . . . . . . . . . . . . . . . . . 128Delegation Connectors (OOM) . . . . . . . . . . . . . . . . . 130Annotations (OOM) . . . . . . . . . . . . . . . . . . . . . . . 132Instance Links (OOM) . . . . . . . . . . . . . . . . . . . . . . 136Domains (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . 141Check Parameters (OOM) . . . . . . . . . . . . . . . . . . . . 146

    iii

  • 3 Building Use Case Diagrams 149Use Case Diagram Basics . . . . . . . . . . . . . . . . . . . . 150Use Cases (OOM) . . . . . . . . . . . . . . . . . . . . . . . . 153Actors (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 157Use Case Associations (OOM) . . . . . . . . . . . . . . . . . 161

    4 Building Dynamic Diagrams 165Introducing Dynamic Diagrams . . . . . . . . . . . . . . . . . 167Communication Diagram Basics . . . . . . . . . . . . . . . . 168Sequence Diagram Basics . . . . . . . . . . . . . . . . . . . 172Activity Diagram Basics . . . . . . . . . . . . . . . . . . . . . 177Statechart Diagram Basics . . . . . . . . . . . . . . . . . . . 180Interaction Overview Diagram Basics . . . . . . . . . . . . . . 184Messages (OOM) . . . . . . . . . . . . . . . . . . . . . . . . 186Activations (OOM) . . . . . . . . . . . . . . . . . . . . . . . . 203Interaction References and Interaction Activities (OOM) . . . 207Interaction Fragments (OOM) . . . . . . . . . . . . . . . . . . 210Activities (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . 214Flows (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 230Transitions (OOM) . . . . . . . . . . . . . . . . . . . . . . . . 234Starts (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 238Ends (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 240Decisions (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . 242Synchronizations (OOM) . . . . . . . . . . . . . . . . . . . . . 246Organization Units (OOM) . . . . . . . . . . . . . . . . . . . . 249Object Nodes (OOM) . . . . . . . . . . . . . . . . . . . . . . . 257States (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 259Events (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . 266Actions (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . 270Junction Points (OOM) . . . . . . . . . . . . . . . . . . . . . . 274

    5 Building Implementation Diagrams 277Introducing Implementation Diagrams . . . . . . . . . . . . . 278Component Diagram Basics . . . . . . . . . . . . . . . . . . . 279Deployment Diagram Basics . . . . . . . . . . . . . . . . . . 282Components (OOM) . . . . . . . . . . . . . . . . . . . . . . . 284Nodes (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 296Component Instances (OOM) . . . . . . . . . . . . . . . . . . 300Files (OOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303Node Associations (OOM) . . . . . . . . . . . . . . . . . . . . 306

    6 Customizing the OOM Environment 309Defining the OOM environment . . . . . . . . . . . . . . . . . 310Specifying the OOM Object Language . . . . . . . . . . . . . 311

    iv

  • Setting OOM Model Options . . . . . . . . . . . . . . . . . . 312Setting OOM Display Preferences . . . . . . . . . . . . . . . 316Working with OOM Extended Model Definitions . . . . . . . . 321Working with OOM Extended Dependencies . . . . . . . . . 323

    7 Working with Web Services 325Web services basics . . . . . . . . . . . . . . . . . . . . . . . 326Defining Web service components . . . . . . . . . . . . . . . 331Managing Web service methods . . . . . . . . . . . . . . . . 342Defining Web service component instances . . . . . . . . . . 352Generating Web services for Java . . . . . . . . . . . . . . . 355Generating Web services for .NET . . . . . . . . . . . . . . . 363Generating Web services for Sybase WorkSpace . . . . . . . 368Reverse engineering Web services . . . . . . . . . . . . . . . 380

    8 Working with Object-Oriented Models 389Defining Related Diagrams . . . . . . . . . . . . . . . . . . . 390Linking Objects to Other Objects . . . . . . . . . . . . . . . . 391Checking an OOM . . . . . . . . . . . . . . . . . . . . . . . . 400Importing and Exporting an OOM in XMI format . . . . . . . . 433Integrating with Other Products . . . . . . . . . . . . . . . . . 435

    9 Reverse Engineering in an OOM 437What is reverse engineering? . . . . . . . . . . . . . . . . . . 438Reverse engineering encoding format . . . . . . . . . . . . . 439Reverse engineering into a new OOM . . . . . . . . . . . . . 441Reverse engineering into an existing OOM . . . . . . . . . . 443Synchronizing a model with generated files . . . . . . . . . . 444

    10 Generating for a Language 447Generation options for languages . . . . . . . . . . . . . . . . 448

    11 Generating Other Models from an OOM 455Generation basics . . . . . . . . . . . . . . . . . . . . . . . . 456Generating an Object-Oriented Model from an Object-

    Oriented Model . . . . . . . . . . . . . . . . . . . . . . . 457Generating a Conceptual Data Model from an Object-

    Oriented Model . . . . . . . . . . . . . . . . . . . . . . . 460Generating a Physical Data Model from an Object-Oriented

    Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470Generating an XML Model from an Object-Oriented Model . . 487

    v

  • II Working with Languages 491

    12 Working with Java 493Introduction to Java and PowerDesigner . . . . . . . . . . . . 494Java Public Classes . . . . . . . . . . . . . . . . . . . . . . . 495Java Enumerated Types (Enums) . . . . . . . . . . . . . . . . 496JavaDoc Comments . . . . . . . . . . . . . . . . . . . . . . . 500Java 5.0 Annotations . . . . . . . . . . . . . . . . . . . . . . . 506Java strictfp Keyword . . . . . . . . . . . . . . . . . . . . . . . 508Enterprise Java Beans (EJBs) v2 . . . . . . . . . . . . . . . . 509Enterprise Java Beans (EJBs) v3 . . . . . . . . . . . . . . . . 546Java Servlets . . . . . . . . . . . . . . . . . . . . . . . . . . . 554Java Server Pages (JSPs) . . . . . . . . . . . . . . . . . . . . 565Generating Java Code . . . . . . . . . . . . . . . . . . . . . . 574Reverse Engineering Java Code . . . . . . . . . . . . . . . . 583

    13 Working with IDL 589Designing for IDL . . . . . . . . . . . . . . . . . . . . . . . . . 590Generating for IDL . . . . . . . . . . . . . . . . . . . . . . . . 601Reverse engineering IDL . . . . . . . . . . . . . . . . . . . . 602

    14 Working with PowerBuilder 607Designing for PowerBuilder . . . . . . . . . . . . . . . . . . . 608Selecting a PowerBuilder version . . . . . . . . . . . . . . . . 611Generating for PowerBuilder . . . . . . . . . . . . . . . . . . . 614Reverse Engineering PowerBuilder . . . . . . . . . . . . . . . 618

    15 Working with VB .NET 625Designing for VB .NET . . . . . . . . . . . . . . . . . . . . . . 626Generating for VB.NET . . . . . . . . . . . . . . . . . . . . . 640Reverse engineering VB .NET . . . . . . . . . . . . . . . . . 643Working with ASP.NET . . . . . . . . . . . . . . . . . . . . . . 650

    16 Working with Visual Basic 2005 657Introduction to Visual Basic 2005 and PowerDesigner . . . . 658Visual Basic 2005 Assemblies . . . . . . . . . . . . . . . . . 659Visual Basic 2005 Compilation Units . . . . . . . . . . . . . . 662Visual Basic 2005 Namespaces . . . . . . . . . . . . . . . . 666Visual Basic 2005 Classes . . . . . . . . . . . . . . . . . . . 667Visual Basic 2005 Interfaces . . . . . . . . . . . . . . . . . . 669Visual Basic 2005 Structs . . . . . . . . . . . . . . . . . . . . 670Visual Basic 2005 Delegates . . . . . . . . . . . . . . . . . . 672Visual Basic 2005 Enums . . . . . . . . . . . . . . . . . . . . 674Visual Basic 2005 Fields, Events, and Properties . . . . . . . 676

    vi

  • Visual Basic 2005 Methods . . . . . . . . . . . . . . . . . . . 679Visual Basic 2005 Inheritance and Implementation . . . . . . 681Visual Basic 2005 Custom Attributes . . . . . . . . . . . . . . 682Generating Visual Basic 2005 Code . . . . . . . . . . . . . . 683Reverse-Engineering Visual Basic 2005 Code . . . . . . . . . 687

    17 Working with C# 693Designing for C# . . . . . . . . . . . . . . . . . . . . . . . . . 694Generating for C# . . . . . . . . . . . . . . . . . . . . . . . . 710Reverse engineering C# . . . . . . . . . . . . . . . . . . . . . 713

    18 Working with C# 2.0 721Introduction to C# 2.0 and PowerDesigner . . . . . . . . . . . 722C# 2.0 Assemblies . . . . . . . . . . . . . . . . . . . . . . . . 723C# 2.0 Compilation Units . . . . . . . . . . . . . . . . . . . . 726C# 2.0 Namespaces . . . . . . . . . . . . . . . . . . . . . . . 730C# 2.0 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . 731C# 2.0 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . 734C# 2.0 Structs . . . . . . . . . . . . . . . . . . . . . . . . . . 735C# 2.0 Delegates . . . . . . . . . . . . . . . . . . . . . . . . . 737C# 2.0 Enums . . . . . . . . . . . . . . . . . . . . . . . . . . 739C# 2.0 Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . 741C# 2.0 Methods . . . . . . . . . . . . . . . . . . . . . . . . . 742C# 2.0 Events, Indexers, and Properties . . . . . . . . . . . . 746C# 2.0 Inheritance and Implementation . . . . . . . . . . . . 750C# 2.0 Custom Attributes . . . . . . . . . . . . . . . . . . . . 751Generating C# 2.0 Code . . . . . . . . . . . . . . . . . . . . . 752Reverse-Engineering C# 2.0 Code . . . . . . . . . . . . . . . 755

    19 Working with XML 761Designing for XML-Schema . . . . . . . . . . . . . . . . . . . 762Generating for XML . . . . . . . . . . . . . . . . . . . . . . . 769Reverse engineering XML . . . . . . . . . . . . . . . . . . . . 771

    20 Working with C++ 777Designing for C++ . . . . . . . . . . . . . . . . . . . . . . . . 778Generating for C++ . . . . . . . . . . . . . . . . . . . . . . . . 780

    Index 781

    vii

  • viii

  • PART I

    OOM GUIDE

    This part explains how to use the Object Oriented Model.

  • x

  • About This Manual

    Subject

    This book describes the PowerDesigner Object-Oriented Modelenvironment. It shows you how to do the following:

    Build an Object-Oriented Model (OOM) using the UML diagrams

    Use modeling elements in diagrams

    Verify the model, merge models and import a Rose model

    Reverse engineer PowerBuilder objects, EJB, Java, and XML files

    Generate files for Java, PowerBuilder, XML, C++, Visual Basic and otherlanguages

    Generate a Conceptual Data Model (CDM), a Physical Data Model(PDM), or an Object-Oriented Model from the OOM

    Generate EJB TM, JSP TM, servlets, ASP.NET

    Create Web services in Java and .NET platforms

    Audience

    Anyone who will be designing or building an OOM with PowerDesignerObject-Oriented Model will find this book useful. It requires anunderstanding of object modeling, as well as familiarity with UML andSQL. Some experience with programming languages is helpful. For moreinformation, see the bibliography at the end of this chapter.

    Terminology

    Most of the terms used along the Object-Oriented Model come from theUnified Modeling Language (UML), defined by the Object ManagementGroup, Inc . (OMG). It is a visual modeling language developed in the mid90s in an effort to summarize and simplify the large number of objectoriented methods that existed at that time. In this manual, we refer to version1.3 of the UML specification, with some updates from version 1.4.

    Documentation primer

    The PowerDesigner modeling environment supports several types of models:

    xi

  • Conceptual Data Model (CDM) to model the overall logical structure ofa database, independent from any software or data storage structureconsiderations

    Physical Data Model (PDM) to model the overall physical structure of adatabase, taking into account DBMS software or data storage structureconsiderations

    Object Oriented Model (OOM) to model a software system using anobject-oriented approach for Java or other object languages

    Business Process Model (BPM) to model the means by which one ormore processes are accomplished in operating business practices

    XML Model (XSM) to model the structure of an XML file using a DTDor an XML schema

    Requirements Model (RQM) to list and document the customer needsthat must be satisfied during a development process

    Information Liquidity Model (ILM) to model the replication ofinformation from a source database to one or several remote databasesusing replication engines

    Free Model (FEM) to create any kind of chart, diagram, in a context-freeenvironment

    This book only explains how to use the OOM. For information on othermodels or aspects of PowerDesigner, consult the following books:

    General Features Guide To get familiar with the PowerDesigner interfacebefore learning how to use any of the models.

    Conceptual Data Model Users Guide To work with the CDM.

    Physical Data Model Users Guide To work with the PDM.

    Business Process Model Getting Started To learn the basics of the BPM.

    Business Process Model Users Guide To work with the BPM.

    XML Model Users Guide To work with an XSM.

    Information Liquidity Model Users Guide To work with an ILM.

    Requirements Model Users Guide To work with an RQM.

    Reports Users Guide To create reports for any or all models.

    Repository Users Guide To work in a multi-user environment using acentral repository.

    xii

  • Typographic conventions

    PowerDesigner documentation uses specific typefaces to help you readilyidentify specific items:

    monospace text (normal and bold)Used for: Code samples, commands, compiled functions and files,references to variables.

    Example: declare user_defined..., the BeforeInsertTriggertemplate.

    bold textAny new term.

    Example: A shortcut has a target object.

    SMALL CAPSAny key name.

    Example: Press the ENTER key.

    Bibliography

    James Rumbaugh, Ivar Jacobson, Grady Booch The Unified ModelingLanguage Reference Manual Addison Wesley, 1999

    Grady Booch, James Rumbaugh, Ivar Jacobson The Unified ModelingLanguage User Guide Addison Wesley, 1999

    Ivar Jacobson, Grady Booch, James Rumbaugh The Unified SoftwareDevelopment Process Addison Wesley, 1999

    Doug Rosenberg, Kendall Scott Use Case Driven Object Modeling WithUML A Practical Approach Addison Wesley, 1999

    Michael Blaha, William Premerlani Object-Oriented Modeling and Designfor Database Applications Prentice Hall, 1998

    Geri Schneider, Jason P. Winters, Ivar Jacobson Applying Use Cases: APractical Guide Addison Wesley, 1998

    Pierre-Alain Muller Instant UML Wrox Press Inc, 1997

    Bertrand Meyer Object-Oriented Software Construction Prentice Hall,2nd Edition, 1997

    Martin Fowler, Kendall Scott UML Distilled Applying The StandardObject Modeling Language Addison Wesley, 1997

    xiii

  • xiv

  • CHAPTER 1

    Getting Started with an Object-OrientedModel

    About this chapter This chapter presents the PowerDesigner Object-Oriented Model. Itintroduces the Unified Modeling Language (UML) diagrams and the supportthat PowerDesigner provides for them.

    Contents Topic: page

    What is an OOM? 2

    Creating an OOM 6

    Working with Languages 9

    1

  • What is an OOM?

    What is an OOM?An Object-Oriented Model (OOM) is a graphical analysis of a system usingthe symbols and language notations of the Unified Modeling Language(UML). UML is the standard language for object-oriented modeling. It wasoriginally devised by Grady Booch, James Rumbaugh, and Ivar Jacobson,and is now controlled by the OMG (Object Management Group).

    UML has a well-defined syntax and semantics that is clear and easy to use inobject modeling. The terminology used in the OOM interface is consistentwith UML, and PowerDesigner supports the following UML diagrams:

    Diagram Group Icon Diagram

    Use Case Diagrams Use case diagram

    Structural Diagrams Class diagram

    Composite structure diagram

    Object diagram

    Package diagram

    Dynamic Diagrams Communication diagram

    Sequence diagram

    Statechart diagram

    Activity diagram

    Interaction overview diagram

    Implementation Diagrams Component diagram

    2

  • Chapter 1. Getting Started with an Object-Oriented Model

    Diagram Group Icon Diagram

    Deployment diagram

    + For detailed information on these diagrams, see:

    The Building Structural Diagrams chapter

    The Building Use Case Diagrams chapter

    The Building Dynamic Diagrams chapter

    The Building Implementation Diagrams chapter

    In the picture below, you can see how the various UML diagrams caninteract within your model:

    3

  • What is an OOM?

    PowerDesigner The PowerDesigner Object-Oriented Model is a powerful design tool forgraphical object-oriented design implementation.

    With this product, you can:

    Build an Object-Oriented Model (OOM) using the standard UMLdiagrams

    Generate and reverse engineer Java, C#, VB.NET, and PowerBuilder files

    Generate code for C++, Visual Basic, IDL-CORBA, etc.

    Generate EJB, servlets, and JSP components

    4

  • Chapter 1. Getting Started with an Object-Oriented Model

    Generate Conceptual Data Models (CDMs), Physical Data Models(PDMs), XML Models (XSMs), and other Object-Oriented Models(OOMs) from your OOM

    Generate an OOM from a CDM, PDM, XML, or other OOM

    Import a Rose model

    Import/export XMI

    Customize the OOM to suit physical and performance considerations

    Customize and print model reports

    + For more information about object modeling, a bibliography is proposedin the About this book section of this manual.

    5

  • Creating an OOM

    Creating an OOMYou can create a new OOM from scratch, or reverse engineer the modelfrom existing OO code.

    + For information about reverse engineering OO code, see the ReverseEngineering chapter.

    v To create a new OOM

    1. Select File New to display the New dialog box.

    2. Select Object-Oriented Model in the list of model types.

    3. Select one of the following radio buttons: New model Creates a new, standard, model. New model from template Creates a model from a model template. A

    model template is a set of model options, display preferences,extension, or objects saved in a model located in the template folder.You use model templates when you need to reuse preferences andoptions in several models.+ For more information about model templates, see the Creating amodel section in the Managing Models chapter , in the GeneralFeatures Guide .

    4. Type a model name in the Model name box. The code of the model,which may be used for script or code generation, is derived from thisname according to the model naming conventions.

    5. Select an Object language from the list.

    Object languages are defined in dedicated XML files (with a .XOLextension), which are provided as part of your PowerDesigner installation

    6

  • Chapter 1. Getting Started with an Object-Oriented Model

    in the \Resource Files\Object Languages directory, and contain all thesyntax and specifications for each target language.

    6. Select one of the following radio buttons: Share the object language definition use the original object language

    file in the Resource Files\Object Languages directory. Any changesmade to the object language are shared by all linked OOM.

    Copy the object language definition in model make a copy of theoriginal object language file in the Resource Files\Object Languagesdirectory. The current object language is independent of the originalobject language, so modifications made to the object language in theObject Languages directory are not available to the OOM. The copiedobject language is saved with the OOM and cannot be used without it.+ For more information on object language properties andcustomizing an object language, see the Understanding the objectlanguage editor section , in the Object Languages Reference Guidechapter in the Advanced User Documentation .

    7. Select the type of the first diagram in the First Diagram list. The first typeof diagram selected remains in memory, and is the default for the nexttime when you create a new OOM.

    You can create as many diagrams as you need in the same OOM. Theyare sorted alphabetically in the Browser, except the diagram specifiedhere, which is always the first in the list.

    8. [optional] If you want to attach one or more extended model definitionsto complement the selected object language, click the Extended ModelDefinitions tab, and select the extended model definitions of your choice.

    + For more information on attaching extended model definition to amodel, see the Extended Model Definitions Reference Guide chapter inthe Advanced User Documentation .

    9. Click OK to create the new OOM in the current Workspace.

    Demo exampleSeveral example OOMs are available in the Examples directory.

    OOM properties

    The Model property sheet displays the definition of the current model.

    An OOM has the following model properties:

    7

  • Creating an OOM

    Property Description

    Name Name for the model

    Code Code for the model. This code is used in scripts

    Comment Descriptive label for the model

    Filename Location of the model file. This box is empty if the modelhas never been saved

    Author Author of the model. You can insert a name, a space, ornothing.

    If you insert a space, the Author field in the title boxremains empty.

    If you intentionally leave the box empty, the Author fieldin the title box displays the user name from the VersionInfo tab of the model property sheet

    Version Version of the model. You can use this box to display therepository version or a user defined version of the model.This parameter is defined in the display preferences of theTitle node

    Object lan-guage

    Current object language for the model

    Default dia-gram

    Diagram displayed by default when opening the model

    8

  • Chapter 1. Getting Started with an Object-Oriented Model

    Working with LanguagesPowerDesigner supports many of the most popular object-orientedlanguages. This section explains some basic ways of examining andgenerating OO code in the PowerDesigner interface.

    + For specific information about your chosen language, see theappropriate chapter in part two of this manual, Working with Languages.

    + For detailed information about generating code see the Generating for aLanguage chapter.

    Previewing the code of an OOM

    You can preview the code of a model or package in order to see thegenerated code, by clicking the Preview tab. The displayed code changesaccording to the object language you have selected in your model.

    For example, if you have created EJB or servlet components in Java, thePreview tab displays the EJB or Web deployment descriptor files. If youhave selected an XML family language, the Preview tab displays the Schemafile that corresponds to the XML file to be generated.

    You can use the following tools and keyboard shortcuts from the Previewtoolbar:

    Tool Description Keyboard shortcut

    Open Editor Contextual menu SHIFT + F11

    Refresh F5

    Show Generation Options CTRL + W

    Select Generation Targets CTRL + F6

    Showing generationoptions

    If you click the Show Generation Options tool, the Generation Optionsdialog box is displayed. You can change generation options from this dialogbox.

    Select GenerationTargets

    When available, this tool displays the list of target extended modeldefinitions selected for generation. If you add a generation target, thecorresponding tab is added to the Preview tab. If you deselect a generationtarget, the corresponding tab disappears from the Preview tab. This tool is

    9

  • Working with Languages

    disabled if no target extended model definition is attached to the model.

    + For more information on the generation targets, see section Defininggeneration targets (XEM), in chapter Generating for a language.

    Script bookmarks In the Preview tab, you can add and remove bookmarks at specific points inthe code and then navigate forwards or backwards from bookmark tobookmark:

    Keyboardshortcut

    Description

    CTRL + F2 Adds a new bookmark. A blue bookmark box is displayed. Ifyou repeat this action from the same position, the bookmarkis deleted and the blue marker disappears

    F2 Jumps to bookmark

    SHIFT + F2 Jumps to previous bookmark

    Note that bookmarks are not printable and are lost if you use the Refresh, orShow Generation Options tools.

    Modifying the code using Preview

    You can modify the code directly from the Preview tab of a class or aninterface, it is a quick and easy way to apply modifications to your code andupdate the model.

    If you want to modify the code, you have to select the Preview Editablecheck box from Tools Model options. This option is applicable to theentire model. Any changes apply as soon as you leave the Preview tab, oryou click the Apply button. Your changes are also displayed in the Outputwindow located in the lower part of the main window.

    The code modified must contain a valid definition otherwise the changes areignored. Your changes only apply to the current class or interface, thereforeyou are not allowed to:

    Move the classifier to another package by changing the packagedeclaration

    Rename a classifier

    You are allowed to create generalization and realization links provided theirclassifiers already exist in the model, if the classifiers do not exist, thencreation is ignored.

    In a model designed for PowerBuilder, this feature can be used to provide aglobal vision of the code of an object and its functions as this is not available

    10

  • Chapter 1. Getting Started with an Object-Oriented Model

    in PowerBuilder. You can use the Preview tab to check where instancevariables are used in the code. You can also modify the body of a function orcreate a new function from an existing function using copy/paste. However,it is still strongly recommended to be very careful when performing suchactions.

    CautionYou should avoid renaming attributes and operations because all attributesthat are not generated, like description, annotation or extended attributeswill be lost.

    Changing the object language of an OOM

    You can change the object language of a model at any time.

    You may be required to change the object language if you open an OOM andthe associated language file has been deprecated, or is otherwise unavailable.In this case the Choose Object Language dialog box will be displayed,inviting you to select a language from the list.

    Object languages are frequently updated in each version of PowerDesignerand it is highly recommended to accept this change, or otherwise you willnot be able to generate for the selected language.

    For more information on how to replace object languages, see theReplacing an object language from version 7 or 8 section, in theMigrating from previous versions document , available in thePowerDesigner Printable Docs directory.

    v To change the object language of a model

    1. Select Language Change Current Object Language to open the ChangeObject Language dialog box .

    11

  • Working with Languages

    2. Select an object language.

    3. Select one of the following radio buttons: Share the object language definition use the original object language

    file in the Resource Files\Object Languages directory. Any changesmade to the object language are shared by all linked OOM.

    Copy the object language definition in model make a copy of theoriginal object language file in the Resource Files\Object Languagesdirectory. The current object language is independent of the originalobject language, so modifications made to the object language in theObject Languages directory are not available to the OOM. The copiedobject language is saved with the OOM and cannot be used without it.

    CautionPowerDesigner is delivered with a set of object languages. It isstrongly advised to make a backup copy of each object languagebefore you start modifying them.

    4. Click OK.

    A message box informs you that the current object language has beenchanged.

    5. Click OK.

    12

  • CHAPTER 2

    Building Structural Diagrams

    About this chapter This chapter describes how to build class, composite structure, and objectdiagrams, and how to create and modify the associated objects.

    Contents Topic: page

    Introducing Structural Diagrams 15

    Class Diagram Basics 16

    Composite Structure Diagram Basics 19

    Object Diagram Basics 22

    Package Diagram Basics 25

    Classes (OOM) 27

    Packages (OOM) 51

    Interfaces (OOM) 55

    Objects (OOM) 59

    Parts (OOM) 65

    Ports (OOM) 68

    Attributes (OOM) 72

    Identifiers (OOM) 82

    Operations (OOM) 86

    Associations (OOM) 102

    Generalizations (OOM) 115

    Dependencies (OOM) 119

    Realizations (OOM) 124

    Require Links (OOM) 126

    Assembly Connectors (OOM) 128

    Delegation Connectors (OOM) 130

    13

  • Topic: page

    Annotations (OOM) 132

    Instance Links (OOM) 136

    Domains (OOM) 141

    Check Parameters (OOM) 146

    14

  • Chapter 2. Building Structural Diagrams

    Introducing Structural DiagramsThe diagrams in this chapter allow you to model the static structure of yoursystem. PowerDesigner provides three types of diagrams for modeling yoursystem in this way, each of which offers a different view of your objects andtheir relationships:

    A class diagram shows the static structure of the classes that make upthe system. You use a class diagram to identify the kinds of objects thatwill compose your system, and to define the ways in which they will beassociated. For more information, see Class Diagram Basics onpage 16.

    A composite structure diagram allows you to define in greater detailthe internal structure of your classes and the ways that they are associatedwith one another. You use a composite structure diagram in particular tomodel complex forms of composition that would be very cumbersome tomodel in a class diagram. For more information, see CompositeStructure Diagram Basics on page 19.

    An object diagram is like a class diagram, except that it shows specificobject instances of the classes. You use an object diagram to represent asnapshot of the relationships between actual instances of classes. Formore information, see Object Diagram Basics on page 22.

    A package diagram shows the structure of the packages that make upyour application, and the relationships between them. For moreinformation, see Package Diagram Basics on page 25.

    15

  • Class Diagram Basics

    Class Diagram BasicsA class diagram is a UML diagram that contains classes, interfaces,packages, and their relationships, and that provides a logical view of all, orpart of a software system.

    You build a class diagram to simplify the interaction of objects in the systemyou are modeling. Class diagrams express the static structure of a system interms of classes and relationships between those classes. A class describes aset of objects, and an association describes a set of links; objects are classinstances, and links are association instances.

    A class diagram does not express anything specific about the links of a givenobject, but it describes, in an abstract way, the potential link from an objectto other objects.

    The following example shows the process of product order and shipment in aclass diagram.

    Class diagram objects

    You can create the following objects in a class diagram:

    Object Tool Symbol Description

    Class Set of objects sharing the same at-tributes, operations, methods, andrelationships. See Classes (OOM)on page 27.

    16

  • Chapter 2. Building Structural Diagrams

    Object Tool Symbol Description

    Interface Descriptor for the externally visibleoperations of a class, object, or otherentity without specification of internalstructure. See Interfaces (OOM)on page 55.

    Port Interaction point between a classifierand its environment. See Ports(OOM) on page 68.

    Generalization Link between classes showing thatthe sub-class shares the structureor behavior defined in one or moresuperclasses. See Generalizations(OOM) on page 115.

    Require Link Connects a class, component, or portto an interface. See Require Links(OOM) on page 126.

    Association Structural relationship between ob-jects of different classes. See Asso-ciations (OOM) on page 102.

    Aggregation A form of association that specifiesa part-whole relationship between aclass and an aggregate class (example:a car has an engine and wheels). SeeAssociations (OOM) on page 102.

    Composition A form of aggregation but with strongownership and coincident lifetimeof parts by the whole; the parts liveand die with the whole (example:an invoice and its invoice line). SeeAssociations (OOM) on page 102.

    Dependency Relationship between two modelingelements, in which a change to oneelement will affect the other element.See Dependencies (OOM) onpage 119.

    17

  • Class Diagram Basics

    Object Tool Symbol Description

    Realization Semantic relationship between classi-fiers, in which one classifier specifiesa contract that another classifier guar-antees to carry out. See Realizations(OOM) on page 124.

    Inner link Exists when a class is declared withinanother class or interface. SeeComposite and inner classifierson page 44.

    Attribute N/A N/A Named property of a class. SeeAssociations (OOM) on page 102.

    Operation N/A N/A Service that can be requested from aclass. See Operations (OOM) onpage 86.

    Creating a class diagram

    You can create a class diagram in an existing OOM in any of the followingways:

    Right-click the model in the Browser and select New Class Diagramfrom the contextual menu

    Right-click the background of any diagram and select Diagram NewDiagram Class Diagram from the contextual menu

    To create a new OOM with a class diagram, select File New, chooseObject-Oriented Model from the Model type list, choose Class Diagram asthe first diagram, and click OK.

    18

  • Chapter 2. Building Structural Diagrams

    Composite Structure Diagram BasicsA composite structure diagram is a UML diagram that contains classes,interfaces, packages, and their relationships, and that provides a logical viewof all, or part of a software system.

    A composite structure diagram performs a similar role to a class diagram,but allows you to go into further detail in describing the internal structure ofmultiple classes and showing the interactions between them. You cangraphically represent inner classes and parts and show associations bothbetween and within classes.

    The example below represents the internal structures of the classes TitleSql(which contains two inner classes) and TitleImp (which contains two parts),and how they are connected via the interfaces dmlAccess andjava.sql.connection1:

    Composite structure diagram objects

    You can create the following types of objects in a composite structurediagram:

    Object Tool Symbol Description

    Class Set of objects sharing the same at-tributes, operations, methods, andrelationships. See Classes (OOM)on page 27.

    Interface Descriptor for the externally visibleoperations of a class, object, or otherentity without specification of internalstructure. See Interfaces (OOM)on page 55.

    19

  • Composite Structure Diagram Basics

    Object Tool Symbol Description

    Port Interaction point between a classifierand its environment. See Ports(OOM) on page 68.

    Part Classifier instance playing a particularrole within the context of anotherclassifier. See Parts (OOM) onpage 65.

    Generalization Link between classes showing thatthe sub-class shares the structureor behavior defined in one or moresuperclasses. See Generalizations(OOM) on page 115.

    Require Link Connects classifiers to interfaces.See Require Links (OOM) onpage 126.

    Assembly Con-nector

    Connects parts to each other. SeeAssembly Connectors (OOM) onpage 128.

    DelegationConnector

    Connects parts to ports on the out-side of classifiers. See DelegationConnectors (OOM) on page 130.

    Association Structural relationship between ob-jects of different classes. See Asso-ciations (OOM) on page 102.

    Aggregation A form of association that specifiesa part-whole relationship between aclass and an aggregate class (example:a car has an engine and wheels). SeeAssociations (OOM) on page 102.

    Composition A form of aggregation but with strongownership and coincident lifetimeof parts by the whole; the parts liveand die with the whole (example:an invoice and its invoice line). SeeAssociations (OOM) on page 102.

    20

  • Chapter 2. Building Structural Diagrams

    Object Tool Symbol Description

    Dependency Relationship between two modelingelements, in which a change to oneelement will affect the other element.See Dependencies (OOM) onpage 119.

    Realization Semantic relationship between classi-fiers, in which one classifier specifiesa contract that another classifier guar-antees to carry out. See Realizations(OOM) on page 124.

    Attribute N/A N/A Named property of a class. SeeAssociations (OOM) on page 102.

    Operation N/A N/A Service that can be requested from aclass. See Operations (OOM) onpage 86.

    Creating a composite structure diagram

    You can create a composite structure diagram in an existing OOM in any ofthe following ways:

    Right-click the model in the Browser and select New Compositestructure Diagram from the contextual menu

    Right-click the background of any diagram and select Diagram NewDiagram Composite structure Diagram from the contextual menu

    To create a new OOM with a composite structure diagram, select File New, choose Object-Oriented Model from the Model type list, chooseComposite structure Diagram as the first diagram, and click OK.

    21

  • Object Diagram Basics

    Object Diagram BasicsAn object diagram is a UML diagram that describes the structure of modelelements and not their behavior or temporary information. The objectdiagram represents instances of classes (objects), instances of association(instance links), and dependencies. However, it does not representinheritance relationships.

    As a diagram of instances, the object diagram shows an example of datastructures with data values that corresponds to a detailed situation of thesystem at a particular point in time.

    The object diagram can be used for analysis purposes: constraints betweenclasses that are not classically represented in a class diagram can typically berepresented in an object diagram.

    If you are novice in object modeling, instances usually have more meaningthan classifiers do, because classifiers represent a level of abstraction.Gathering several instances under the same classifier helps you tounderstand what classifiers are. Moreover, even for analysts used toabstraction, the object diagram can help understand some structuralconstraints that cannot be easily graphically specified in a class diagram.

    In this respect, the object diagram is a limited use of a class diagram. Forexample, see the following figures representing a class and an objectdiagram: the class diagram specifies that a class Writer is linked to a classDocument.

    The object diagram, deduced from this class diagram, highlights some of thefollowing details: the object named John, instance of the class Writer islinked to two different objects Draft and Master that are both instances of theclass Document.

    22

  • Chapter 2. Building Structural Diagrams

    Dragging classes and associations to an object diagramYou can drag classes and associations from the Browser and drop them intoan object diagram. If you drag classes, new objects as instances of classesare created. If you drag an association, a new instance link as instance ofthe association, and two objects are created.

    23

  • Object Diagram Basics

    Object diagram objects

    You can create the following objects in an object diagram:

    Object Tool Symbol Description

    Object Instance of a class. See Objects(OOM) on page 59.

    Attribute values N/A N/A An attribute value represents an in-stance of a class attribute, this attributebeing in the class related to the object.See Object property sheet AttributeValues tab on page 62.

    Instance link Communication link between two ob-jects. See Instance Links (OOM)on page 136.

    Dependency Relationship between two modelingelements, in which a change to oneelement will affect the other element.See Dependencies (OOM) onpage 119.

    Creating an object diagram

    You can create an object diagram in an existing OOM in any of thefollowing ways:

    Right-click the model in the Browser and select New Object Diagramfrom the contextual menu

    Right-click the background of any diagram and select Diagram NewDiagram Object Diagram from the contextual menu

    To create a new OOM with an object diagram, select File New, chooseObject-Oriented Model from the Model type list, choose Object Diagram asthe first diagram, and click OK.

    24

  • Chapter 2. Building Structural Diagrams

    Package Diagram BasicsAn package diagram is a UML diagram that describes the package structureof the application. You create a package diagram when you want a high-leveloverview of the organization of your application, and can use generalizationand dependency links to show the interactions between the packages.

    You can control the level of detail shown for each package, by togglingbetween the standard and composite package views via the Edit orcontextual menus.

    In the following example, the WebShop package imports the Cart package,which, in turn, imports the Types package, and has access to the Auxiliarypackage. The Types package is shown in composite view:

    25

  • Package Diagram Basics

    Package diagram objects

    You can create the following objects in an package diagram:

    Object Tool Symbol Description

    Package A container for organizing your modelobjects. See Packages (OOM) onpage 51.

    Generalization Link between packages showing thatthe sub-package shares the structureor behavior defined in one or moresuper-packages. See Generalizations(OOM) on page 115.

    Dependency Relationship between two packages,in which a change to one package willaffect the other. See Dependencies(OOM) on page 119.

    Creating a package diagram

    You can create a package diagram in an existing OOM in any of thefollowing ways:

    Right-click the model in the Browser and select New Package Diagramfrom the contextual menu

    Right-click the background of any diagram and select Diagram NewDiagram Package Diagram from the contextual menu

    To create a new OOM with a package diagram, select File New, chooseObject-Oriented Model from the Model type list, choose Package Diagramas the first diagram, and click OK.

    26

  • Chapter 2. Building Structural Diagrams

    Classes (OOM)A class is a description of a set of objects that have a similar structure andbehavior, and share the same attributes, operations, relationships, andsemantics.

    A class can be created in the following diagrams:

    Class Diagram

    Composite Structure Diagram

    The structure of a class is described by its attributes and associations, andits behavior is described by its operations.

    Classes, and the relationships that you create between them, form the basicstructure of an OOM. A class defines a concept within the application beingmodeled, such as:

    a physical thing (like a car),

    a business thing (like an order)

    a logical thing (like a broadcasting schedule),

    an application thing (like an OK button),

    a behavioral thing (like a task)

    The following example shows the class Aircraft with its attributes (range andlength) and operation (startengines).

    Creating a class

    You can create a class in any of the following ways:

    Use the Class tool in the diagram Palette

    Select Model Classes to access the List of Classes, and click the Add aRow tool

    Right-click the model or package in the Browser, and select New Class

    Right-click an interface, and select Create Class from the contextualmenu (this method allows you to inherit all the operations of theinterface, including the getter and setter operations, creates a realization

    27

  • Classes (OOM)

    link between the class and the interface, and shows this link in theRealizes sub-tab of the Dependencies tab of the class property sheet).

    + For general information about creating objects, see the chapter GettingStarted with PowerDesigner in the General Features Guide .

    Class properties

    You can modify an objects properties from its property sheet. To open aclass property sheet, double-click its diagram symbol or its Browser entry inthe Classes folder. The following sections detail the property sheet tabs thatcontain the properties most commonly entered for classes.

    Class property sheet General tab

    The General tab contains the following properties:

    Property Description

    Name Specifies the name of the item, which should be clear andmeaningful, and should convey the items purpose to non-technical users.

    Code Specifies the technical name of the object, which is used forgenerating code or scripts.

    Comment Descriptive comment for the object.

    Extends Specifies the parent class (to which the present class is linkedby a generalization). Click the Select Classifier tool to theright to specify a parent class and click the Properties tool toaccess its property sheet.

    28

  • Chapter 2. Building Structural Diagrams

    Property Description

    Stereotype Extends the semantics of the object beyond the core UMLdefinition. The following common stereotypes are availableby default: - Coherent set of roles that users play

    - List of named values used as therange of an attribute type

    - Exception class, mainly used in relationto error messages

    - Class whose instances arestatically typed. Defines the physical data structure andmethods of a class as implemented in traditional program-ming languages

    - Heavyweight flow that executes concur-rently with other processes

    - Specification of asynchronous stimulus be-tween instances

    - a metaclass of some other class

    - a metaclass whose instances are sub-classes of another class

    - Lightweight flow that executes concur-rently with other threads within the same process. Usuallyexecutes inside the address space of an enclosing process

    - Abstract class used to specify the structureand behavior of a set of objects but not the implementation

    - Class that has no instancesOther language-specific stereotypes may be available. Thesestereotypes are defined in the object language file. For moreinformation, see the Stereotypes category section, in theObject Languages Reference Guide chapter of Advanced UserDocumentation.

    Visibility Specifies the visibility of the object, how it is seen outsideits enclosing namespace. When a class is visible to anotherobject, it may influence the structure or behavior of the object,and/or be affected by it. You can choose between: Private only to the object itself

    Protected only to the object and its inherited objects

    Package to all objects contained within the same package

    Public to all objects (option by default)

    29

  • Classes (OOM)

    Property Description

    Cardinality Specifies the number of instances a class can have. You canchoose between: 0..1 None to one

    0..* None to an unlimited number

    1..1 One to one

    1..* One to an unlimited number

    * Unlimited number

    Type Allows you to specify that a class is a generic type, or that it isbound to one. You can choose between: Class

    Generic

    Bound If you select this option, then an additional listbecomes available to the right, where you can specify thegeneric type to which the class is bound. You can use thetools to the right of the list to create an object, browse thecomplete tree of available objects or view the properties ofthe currently selected object.

    If you specify either Generic or Bound, then the Generic tab isdisplayed, allowing you to control the associated type variables(see Class property sheet Generic tab on page 33). Formore information on generic types and binding classes tothem, see the Generic types and methods on page 40section.

    Abstract Specifies that the class cannot be instantiated and therefore hasno direct instances.

    Final Specifies that the class cannot have any inherited objects.

    Generatecode

    Specifies that the class is included when you generate codefrom the model, it does not affect inter-model generation.

    + For more information on how to manipulate categories and entries in theobject language, see the The Resource Editor chapter in the GeneralFeatures Guide.

    + For more information on extended model definitions, see the Workingwith extended model definitions section in the Managing Objects chapterin the General Features Guide .

    30

  • Chapter 2. Building Structural Diagrams

    Class property sheet Detail tab

    The Detail tab contains a Persistent groupbox whose purpose is to definedthe persistent generated code of a class during OOM to CDM or PDMgeneration. For more information on object persistence, see the Managingobject persistence during OOM to PDM generation section, in theGenerating Other Models from an OOM chapter.

    The complete list of options on this tab is as follows:

    Property Description

    Persistent Specifies that the class must be persisted in a generated CDMor PDM. You have to select one of the following options: Generate table - the class is generated as a table.

    Migrate columns - the class is not generated, and its at-tributes and associations are migrated to the generatedparent or child table.

    Generate ADT - the class is generated as an abstract datatype, a user-defined data type that can encapsulate a rangeof data values and functions. See Using abstract datatypes, in the Building Physical Diagrams chapter inthe Physical Data Model Users Guide .

    Value Type the class is not generated, and its attributesare generated in their referencing types.

    Code Specifies the code of the table or entity that will be generatedfrom the current class in a CDM or PDM model. Persistentcodes are used for round-trip engineering: the same classalways generates the same entity or table with a codecompliant with the target DBMS.

    Example: to generate a class Purchaser into a table PURCH,type PURCH in the Code box.

    Inner to Specifies the name of the class or interface to which thecurrent class belongs as an inner classifier

    Associationclass

    Specifies the name of the association related to the class toform an association class. The attributes and operations ofthe current class are used to complement the definition of theassociation.

    + For more information on other properties specific to Web services, see

    31

  • Classes (OOM)

    the Detail page of the class section, in the Working with Web Serviceschapter.

    Class property sheet Attributes tab

    The Attributes tab lists the attributes associated with the class. You cancreate attributes directly in this tab, or add already existing attributes. Formore information, see the Attributes (OOM) on page 72 section.

    Class property sheet Identifiers tab

    The Identifiers tab lists the identifiers associated with the class. You cancreate identifiers directly in this tab. For more information, see theIdentifiers (OOM) on page 82 section.

    Class property sheet Operations tab

    The Operations tab lists the operations associated with the class. You cancreate operations directly in this tab, or add already existing operations. Formore information, see the Operations (OOM) on page 86 section.

    Class property sheet Ports tab

    The Ports tab lists the ports associated with the class. You can create portsdirectly in this tab. For more information, see the Ports (OOM) onpage 68 section.

    Class property sheet Parts tab

    The Parts tab lists the parts associated with the class. You can create partsdirectly in this tab. For more information, see the Parts (OOM) onpage 65 section.

    Class property sheet Associations tab

    The Associations tab lists the associations associated with the class. Formore information, see the Associations (OOM) on page 102 section.

    Class property sheet Inner Classifiers tab

    The Inner Classifiers tab lists the inner classes and interfaces associated withthe class. You can create inner classifiers directly in this tab. For moreinformation, see the Composite and inner classifiers on page 44 section.

    32

  • Chapter 2. Building Structural Diagrams

    Class property sheet Generic tab

    The Generic tab allows you to specify either:

    That the class is a generic type, and to list its type parameters, or

    That the class is bound to a generic type, and to give values for therequired type parameters

    For more information, see the Generic types and methods on page 40section.

    Class property sheet Related Diagrams tab

    The Related Diagrams tab lists the model diagrams that are related to theclass. You can add diagrams in this tab.

    + For more information, see the Defining related diagrams section, inthe chapter Working with Object-Oriented Models.

    Class property sheet Script tab

    The Script tab allows you to customize the objects creation script by, forexample, adding descriptive information about the script.

    Examples If a development project archives all the creation scripts that are generated, aheader script can be inserted before each creation script, indicating the date,time, and any other information specific to the generated script.

    If an organization requires that generated scripts are filed using a namingsystem which may be independent from a script name, a header script coulddirect a generated script to be filed under a different name than the nameindicated in the creation script.

    Scripts can be customized as follows:

    Insert scripts at the beginning (Header page) and the end (Footer page) ofa script

    Insert scripts before and after a class or interface creation command(Imports page)

    Script tools The following tools and shortcut keys are available on the Script tab:

    33

  • Classes (OOM)

    Tool Description Shortcut Key

    Open Editor Contextual menu SHIFT + F11

    Edit With - Opens the default editor you pre-viously defined or allows you to select anothereditor if you click the down arrow beside thistool

    CTRL + E

    Import Folder - Available in the Imports tabbedpage only. Opens a selection window to se-lect packages to import. The packages areadded where the cursor is positioned. They areprefixed by the keyword import

    Import Classifier - Available in the Importstabbed page only. Opens a selection window toselect classifiers to import. The classifiers areadded where the cursor is positioned. They areprefixed by the keyword import

    + For more information on defining a default editor, see section Defining atext editor, in chapter Using the PowerDesigner Interface in the GeneralFeatures Guide .

    Formatting variables incustomized scripts

    Variables have a syntax that can force a format on their values in thefollowing ways:

    Force values to lowercase or uppercase characters

    Truncate the length of values

    When a variable does not specify formatting, its values have the same formatas in the OOM. You can use the following formatting syntax with variables:

    Format code Format of variable value in script

    .L Lowercase characters

    .T Removes blank spaces

    .U Uppercase characters

    .c Upper-case first letter and lower-case next letters

    .n Maximum length where n is the number of characters

    .nJ Justifies to fixed length where n is the number of characters

    You embed formatting options in variable syntax as follows:

    34

  • Chapter 2. Building Structural Diagrams

    %.format:variable%

    Class property sheet Preview tab

    The Preview tab allows you to preview the code that will be generated forthe class.

    Preview tools The following tools and shortcut keys are available on the Preview tab:

    35

  • Classes (OOM)

    Tool Description Shortcut Key

    Open Editor Contextual menu. SHIFT + F11

    Refresh. F5

    Show Generation Options - This dialog boxallows you to change generation options and seethe impact on the code. This feature is especiallyuseful when you are working with Java. Forother object languages, generation options do notinfluence the code.

    CTRL + W

    Select Generation Targets - displays the listof targets for the current object. If you add ageneration target, the corresponding tab is addedto the Preview tab. If you deselect a generationtarget, the corresponding tab disappears from thePreview tab.

    This option is only available when at least oneextended model definition flagged for generationis linked to the model, and when it containsGenerated Files entries for the current object.

    For more information on generation targets, seethe Generation targets section in the ExtendedModel Definitions Reference Guide chapter, inthe Advanced User Documentation .

    CTRL + F6

    Script bookmarks In the Preview tab, you can add and remove bookmarks at specific points inthe code and then navigate forwards or backwards from bookmark tobookmark:

    Shortcut Description

    CTRL + F2 Adds a new bookmark. A blue bookmark box is displayed. Ifyou repeat this action from the same position, the bookmarkis deleted and the blue marker disappears

    F2 Jumps to bookmark

    SHIFT + F2 Jumps to previous bookmark

    Note that bookmarks are not printable and are lost if you use the Refresh, orShow Generation Options tools.

    36

  • Chapter 2. Building Structural Diagrams

    Creating Java BeanInfo classes

    If you are using the Java object language, you can create Java BeanInfoclasses from any class with a type of JavaBean.

    A JavaBean is a reusable software component written in Java that can bemanipulated visually in a builder tool. A Java BeanInfo class is used as astandard view of a Bean. Each JavaBean can implement a BeanInfo class.Bean implementors may want to provide explicit information about themethods, properties, and events of a Bean by providing a Java BeanInfoclass.

    The BeanInfo class is generated with an attribute, and the followingoperations:

    constructor

    getPropertyDescriptors();

    getMethodDescriptors();

    You can view the complete code by clicking the Preview tab in the BeanInfoclass property sheet.

    Attribute created The attribute has the following code:

    private static final Class Class = .class;

    Operations created The constructor has the following code:

    BeanInfo(){

    super();}

    The getPropertyDescriptors() operation has the following code:

    37

  • Classes (OOM)

    public PropertyDescriptor[] getPropertyDescriptors (){// Declare the property arrayPropertyDescriptor properties[] = null;

    // Set propertiestry{

    // Create the arrayproperties = new PropertyDescriptor[];// Set property 1properties[0] = new PropertyDescriptor(""

    ,Class;properties[0].setConstrained(false);properties[0].setDisplayName("propertyName1");properties[0].setShortDescription("propertyComment1");// Set property 2properties[1] = new PropertyDescriptor(""

    ,Class;properties[1].setConstrained(false);properties[1].setDisplayName("propertyName2");properties[1].setShortDescription("propertyComment2");

    }catch{

    // Handle errors}return properties;}

    + The getMethodDescriptors() operation has the following code:

    38

  • Chapter 2. Building Structural Diagrams

    public MethodDescriptor[] getMethodDescriptors (){// Declare the method arrayMethodDescriptor methods[] = null;ParameterDescriptor parameters[] = null;

    // Set methodstry{

    // Create the arraymethods = new MethodDescriptor[];// Set method 1parameters = new ParameterDescriptor[];parameters[0] = new ParameterDescriptor();parameters[0].setName("parameterCode1");parameters[0].setDisplayName("parameterName1");parameters[0].setShortDescription("parameterComment1");methods[0] = new MethodDescriptor("",

    parameters);methods[0].setDisplayName("methodName1");methods[0].setShortDescription("methodComment1");// Set method 2methods[1] = new MethodDescriptor("");methods[1].setDisplayName("methodName2");methods[1].setShortDescription("methodComment2");

    }catch{

    // Handle errors}return methods;}

    When you create a Java BeanInfo class, a dependency link is automaticallycreated between both classes and the stereotype of the Java BeanInfo class isset to .

    Creating a Java BeanInfoclass from the Languagemenu

    39

  • Classes (OOM)

    v To create a Java BeanInfo class from the Language menu

    1. Select Language Create BeanInfo Classes to display the CreateBeanInfo Classes selection window. This window contains a list of all theclasses of type JavaBean in the model.

    2. Select the classes for which you want to generate Java BeanInfo classesand click OK.

    A BeanInfo class is created in the model for each selected class.

    Creating a Java BeanInfoclass from the classcontextual menu v To create a Java BeanInfo class from the class contextual menu

    1. Right-click a class in the diagram, and select Create BeanInfo Class fromthe contextual menu.

    Generic types and methods

    Generic types and methods are a new feature of Java 5.0. A generic type is aclass or interface that has one or more type variables and one or more

    40

  • Chapter 2. Building Structural Diagrams

    methods that use a type variable as a placeholder for an argument or returntype.

    Using generic types and methods allows you to take advantage of strongercompile-time type checking. When a generic type is used, an actual type isspecified for each type variable. This additional type information is used bythe compiler to automatically cast the associated return values.

    Creating generic types

    PowerDesigner allows you to designate classes and interfaces as generictypes.

    You define a list of type variables that will be used as datatypes for attributes,method parameters, or return types. PowerDesigner requires the existence ofa bound class to create a generalization, realization, or association.

    You then bind a classifier to the generic type via this intermediate boundclass, and specify the actual types to be used in place of the required typevariables.

    v To designate a class or interface as a generic type

    1. Open the property sheet of the class or interface, and select Generic fromthe Type list on the General tab. The Generic tab will be automaticallydisplayed, and a type variable created in the list in the tab.

    2. Click the Generic tab, and add any additional type variables that yourequire with the Add a Row tool. You can also specify a derivationconstraint in the form of a list of types.

    3. Click OK to return to the diagram. The classifier symbol will now displaythe type variables on its top-left corner.

    In order for the classifier to become a true generic type, it must contain atleast one generic method.

    Creating generic methods

    PowerDesigner allows you to designate operations as generic methods.Generic methods are methods that have their own list of type variables.

    41

  • Classes (OOM)

    v To create a generic method

    1. Open the property sheet of the class or interface and click on itsOperations tab.

    2. Click the Add a Row tool to create a new operation, and then click theProperties tool to open its property sheet.

    3. Click Yes to confirm the creation of the operation, and then select theGeneric checkbox on the General tab of the new operation property sheetto designate the operation as a generic method. The Generic tab will beautomatically displayed, and a type variable created in the list in the tab.

    4. Add any additional type variables that you require with the Add a Rowtool, and then click OK.

    Creating a specialized classifier

    If you need to create a classifier that will inherit from a generic type, youmust create an intermediary bound classifier. The Generic ClassifierSpecialization Wizard can perform these steps for you.

    v To create a specialized classifier with the Generic Classifier Spe-cialization Wizard1. Right-click a generic class or interface, and select Create Specialized

    Class (or Interface) from the contextual menu to open the GenericClassifier Specialization Wizard:

    2. Enter a Name and Code for the specialized classifier, and then click Nextto go to the type parameters page.

    42

  • Chapter 2. Building Structural Diagrams

    3. Specify values for each of the type parameters in the list. If you do notspecify a value for a type parameter, it will be added as a type parameterto the new specialized classifier.

    4. Click Finish to return to the diagram. The wizard will have created thespecialized classifier and also a bound classifier which acts as anintermediary between the generic and the specialized classifiers, in orderto specify values for the type parameters.

    The bound classifier is attached to the generic classifier via a dependencywith a stereotype of , and acts as the parent of the specializedclassifier, which is connected to it by a generalization.

    In the example below, SpecializedClass inherits from GenericClass viaGenericClass_Bound, which specifies type parameters for the generictypes T, T_2, and T_3.

    At compile time, the specialized classifier can inherit the methods andproperties of the generic classifier, and the generic type variables will bereplaced by actual types. As a result, the compiler will be able to providestronger type checking and automatic casting of the associated returnvalues.

    Creating a bound classifier

    You may need to bind a classifier to a generic classifier without creating aspecialized classifier. The Bound Classifier Wizard can do this for you.

    v To create a bound classifier with the Bound Classifier Wizard

    1. Right-click a generic class or interface, and select Create Bound Class (orInterface) from the contextual menu to launch the Bound ClassifierWizard.

    2. The wizard will create the bound classifier, which is attached to thegeneric classifier via a dependency with a stereotype of .

    43

  • Classes (OOM)

    Generic type example

    In the example below, the bound interface, List_T, specifies a type T forthe type parameter of List.

    The generic class Vector realizes the generic interface List (viathe bound interface List_T) with a type (that is defined in its owngeneric definition):

    public class vector implements List

    The bound class Vector_Integer specifies a type Integer for the typeparameter of Vector. The SimpleVectorProgram class isassociated to Vector_Integer, allowing it to use the attribute data type of theVector class set to Integer.

    You must create a bound class for a generalization or a realization. However,we could have specified a parameter value for the generic type directly(without creating a bound class) as an attribute data type, parameter datatype, or return data type, by simply typing the following expression in thetype field of SimpleVectorProgram:

    Vector

    Composite and inner classifiers

    A composite classifier is a class or an interface that contains other classes orinterfaces (called inner classifiers). Inner classifiers are listed in the Browseras children of their composite classifier:

    44

  • Chapter 2. Building Structural Diagrams

    Inner classifiers can be displayed directly in the main class diagram, or in aadditional class diagram specific to the composite classifier:

    Main diagram (with inner links) Composite Classifier Diagram

    Note: You can display multiple composite classifiers in a composite structurediagram (see Composite Structure Diagram Basics on page 19).

    Note: In previous versions of PowerDesigner, there was no compositeclassifier and inner classifiers used to appear at the same hierarchical level astheir parent in the Browser tree view and in the list of classifiers.

    Creating inner classifiers

    You can create inner classifiers in a class or interface in any of the followingways:

    Open the Inner Classifiers tab in the property sheet of a class or interface,and click the Add inner class or Add inner interface tool.

    Right-click a class or interface in the Browser, and select New Class orNew Interface

    Select the Inner Link tool in the Palette and click and use it to connect

    45

  • Classes (OOM)

    two classes in the diagram. The first class will become a composite classand the second, an inner classifier

    Create a composite classifier diagram dedicated to the class (seefollowing section), and create classes or interfaces there.

    All inner classifiers are listed in the bottom of the class symbol

    Creating a composite classifier diagram

    You may want to create a diagram to show the internal structure of acomposite classifier. You can create a composite classifier diagram in any ofthe following ways:

    Right-click a class or interface in the Browser, and select New ClassDiagram

    Double-click a class or interface in the diagram while holding down theCTRL key

    The composite classifier diagram will be empty by default, even if thecomposite classifier already includes some inner classifiers. You can createsymbols for the internal classifiers by selecting Symbol Show Symbols, orby dragging and dropping them from the Browser to the diagram.

    If you have created a composite classifier diagram, you can display it in themain class diagram by right-clicking the class symbol and selectingComposite View.

    Attaching a classifier to a data type or a return type

    A data type or a return type can be a classifier. You can choose to attach aclass, an interface, or a classifier from a JDK library for example, to thefollowing objects:

    Attribute data type

    Operation return type

    Parameter data type

    The classifier can belong to the current model or to another model. If itbelongs to the current model or package, it is displayed by default togetherwith the other classifiers of the current package. If it belongs to anothermodel or package, a shortcut of the classifier is automatically created in thecurrent package.

    46

  • Chapter 2. Building Structural Diagrams

    Fully qualified name If the classifier belongs to another package of the same model, you canmanually attach the classifier to a data type or return type by typing the fullyqualified name of the classifier directly in the data type or return type box.

    For example, if you need to reference Class_2 as a classifier data type of anattribute named Attr_1 in Class_1, open the Attr_1 property sheet and typePACKAGE_2.CLASS_2 in the Data type list.

    Package_1

    |__ Class_1

    |__ Attr_1

    Package_2

    |__ Class_2

    After you type the fully qualified name (path and classifier name), it isdisplayed in the data type or return type box.

    When a data type or a return type is created, there is no classifier attached toit, that is why the Use fully qualified name check box is not selected in theSelect a Classifier dialog box.

    However if you type a relative name, like Lang.Integer instead ofJava.Lang.Integer, the Use fully qualified name check box is automaticallyselected because a fully qualified name corresponds to this name.

    47

  • Classes (OOM)

    v To attach a classifier

    1. Double-click a class in the diagram to display its property sheet. To attach a classifier to an attribute data type, click the Attributes tab,

    select an attribute in the list, and click the Properties tool to open theattribute property sheet.

    To attach a classifier to an operation return type, click the Operationstab, select an operation in the list, and click the Properties tool to openthe operation property sheet.

    To attach a classifier to an operation parameter data type, click theOperations tab, select an operation in the list, and click the Propertiestool to open the operation property sheet. Then click the Parameterstab, select a parameter in the list, and click the Properties tool to openthe parameter property sheet

    2. Click the Select a Classifier button beside the Data type listbox to openthe Selection window. This window contains a list of all the classifiers inthe model.

    3. Select the classifier to be attached and click OK to return to the propertysheet. The classifier name is now displayed in the Data type list.

    4. Click OK.

    Synchronizing data type and classifierWhen you select a data type that matches the code of a classifier, the datatype is automatically synchronized if the code of the classifier changes.

    Viewing the migrated attributes of a class

    Navigable associations migrate attributes to classes during code generation.You can display these migrated attributes in the Associations tab of a classproperty sheet.

    In the following example, the class Employee is associated with the classCompany.

    If you preview the generated code of the class Employee, you can see thefollowing three attributes (in Java language):

    48

  • Chapter 2. Building Structural Diagrams

    public class EMPLOYEE{

    public COMPANY hires[];public int NAME;public int DEPARTMENT;

    }

    The association between Employee and Company is migrated as the attributepublic COMPANY hires [].

    You can use the Associations tab of a class property sheet to display the listof all migrated attributes proceeding from navigable associations.

    Inherited Associations When a class inherits from a parent class through a generalization link, youcan use the list of Inherited Associations to view the list of migratedattributes from the parent of the current class.

    For example, the class Developer inherits from Employee through ageneralization.

    If you double-click the class Developer, click the Associations tab in theclass property sheet and click the Inherited button, the list of InheritedAssociations displays the migrated attribute of the class Employee.

    49

  • Classes (OOM)

    + For more information on associations, see the Associations (OOM)on page 102 section.

    50

  • Chapter 2. Building Structural Diagrams

    Packages (OOM)A package is a general purpose mechanism for organizing elements intogroups. It contains model objects and is available for creation in alldiagrams.

    When you work with large models, you can split them into smallersubdivisions to avoid manipulating the entire set of data of the model.Packages can be useful to assign portions of a model, representing differenttasks and subject areas to different development teams.

    Package hierarchy You can create several packages at the same hierarchical level within amodel or decompose a package into other packages and continue thisprocess without limitation in decomposition depth. Each package isdisplayed with a default diagram window. At each level of decompositionyou can create several diagrams.

    However, in an activity or statechart diagram, it is not possible to create apackage in a composite activity or composite state since those ones arebehaving like a package.

    + For more information on packages, see section Defining a package, inchapter Managing Models in the General Features Guide .

    Composite view You can expand a package to have a global view of the whole diagramcontent.

    To do so, you have to right-click a package and select Composite View fromthe contextual menu. You must resize the composite package symbol tovisualize its content:

    51

  • Packages (OOM)

    To return to the package normal view, re-select the Composite Viewcommand in the contextual menu of the expanded package.

    Note that if you double-click the composite view, you automatically openthe sub-package diagram.

    + For more information on the composite view feature, see sectionExpanding the symbol of a composite object in chapter Model Graphics inthe General Features Guide.

    You can create any type of diagrams in a package, or in a model. You usepackages to organize your objects into functional or organizational domains.

    If you delete a package, you also delete the diagrams and the objects itcontains.

    Objects created in a model or a package are shared between the diagrams ofsame type created in the same model or package.

    OOM Package properties

    Packages have properties displayed on property sheets. All packages sharethe following common properties:

    Property Description

    Name Name that clearly identifies the package

    Code Codes are references for packages

    52

  • Chapter 2. Building Structural Diagrams

    Property Description

    Comment Optional label that describes a package and provides addi-tional information

    Stereotype Sub-classification derived from an existing package. Thefollowing stereotypes are available by default: Jar or War archive (Java only)

    Specifies that a package produces aportable executable (PE), (C# and VB.NET only)

    UML Package identified as IDLmodule (IDL-CORBA only)

    Package is a view of another package

    Package consists mostly of patterns

    Package is an abstraction of anotherpackage

    Specifies a semantically closed abstrac-tion of a system

    Package serves as a proxy for the publiccontents of another package

    Grouping of elements, some of whichconstitute a specification of the behavior offered by theother contained elements

    Package represents the entire system be-ing modeled

    Package that contains other pack-ages with the same physical system. It also contains allrelationships and constraints between model elements con-tained in different models

    Indicates the top-most package in acontainment hierarchy

    Use parentnamespace

    Defines the package as being the area in which the name of anobject must be unique in order to be used

    Default dia-gram

    Diagram displayed by default when opening the package

    Previewing the code of a package in an OOM

    You can preview the code of a model or package in order to see the

    53

  • Packages (OOM)

    generated code, by clicking the Preview tab. The displayed code changesaccording to the object language you have selected in your model.

    Defining the diagram type of a new package

    When you create a new package, the default diagram of the package isdefined according to the following parameters:

    If you create a package using the Package tool from the palette, thediagram is of the same type as the parent package or model.

    If you create a package from the Browser, the diagram is of the same typeas existing diagrams in the parent package or model, if these diagramsshare the same type. If diagrams in the parent package or model are ofdifferent types, you are asked to select the type of diagram for the newsub-package.

    If you create a package from the List of Packages, the diagram is of thesame type as the active diagram.

    54

  • Chapter 2. Building Structural Diagrams

    Interfaces (OOM)An interface is similar to a class but it is used to define the specification of abehav