umlmagicdraw

Upload: franz-leon

Post on 03-Apr-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 UMLMagicDraw

    1/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using

    MagicDraw

    UML for Java Programmers

  • 7/28/2019 UMLMagicDraw

    2/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Topics?

    What is UML

    How UML is used

    What is MagicDraw

    What UML and MagicDraw provides for Java

    programmers?

    o we go through features supported in MagicDraw

    Demo

  • 7/28/2019 UMLMagicDraw

    3/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    What is UML?

    The UML (Unified Modeling Language) was designedwith two objectives in mind:

    To reflect the best practices of the industry

    To demystify the process of software system

    modeling.(refer toAppendix A. for more details) UML is a graphical notation for drawing diagrams of

    software concepts, which allows your development teamto quickly grasp the functionality contained within theapplication.

    UML is a language and a process with neutral notation,which means that you may use it to design your entireOO system in any programming language and anysoftware development process and modeling.

  • 7/28/2019 UMLMagicDraw

    4/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    How UML is used?In recent years, the tools for OO software modeling have

    emerged, followed by the development of the visual

    modeling approach. Visual modeling means that you first

    design your system by drawing diagrams (blueprints)

    and then employ tools to convert those diagrams into

    code.

    What is visual model tools?Today, visual modeling tools provide many features thatreplace some of the more tedious tasks for the designer,

    programmer, and documentation writer.

  • 7/28/2019 UMLMagicDraw

    5/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    What is MagicDraw?MagicDraw is a visual UML modeling and CASE toolwith

    teamwork support. Designed for Business Analysts,

    Software Analysts, Programmers, QA Engineers, and

    Documentation Writers; this dynamic and versatile

    development tool facilitates analysis and design of Object

    Oriented (OO) systems and databases.

    MagicDraw Java version Provides Code engineering for

    Java, Java bytecode. Integration with Java IDEs.

    The detailed list of MagicDraw features find at:http://www.magicdraw.com/files/brochures/a4/MagicDrawDataSheet.pdf

  • 7/28/2019 UMLMagicDraw

    6/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    UML Diagrams ?

    In software development, the diagram is the equivalent of

    a blueprint. To meet the various needs of many parties,

    we often need several different blueprints of the same

    system.

    UML has three main kinds of diagrams:

    Static Diagrams: Classes, Objects, data structure

    Dynamic Diagrams: show flow of executions and changeof states

    Physical Diagrams: source file,libraries, data filesMagicDraw supports the following diagrams defined in

    UML1.4:Class diagram, Object diagram, Use case diagram, Statechart diagram,Activity diagram, Collaboration diagram, Sequence diagram, Component diagram,Deployment diagram

  • 7/28/2019 UMLMagicDraw

    7/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Class Diagram ?

    A class diagram is a graphic representation of the static

    structural model. It shows classes and interfaces, along

    with their internal structure and relationships. Classes

    represent types of objects that are handled in a

    system.The instances of those types (objects) are

    instantiated only on the runtime and are represented by an

    object and interaction diagrams.

    Classescan be related to each other in a number of ways:

    Associated (connected to each other)

    Dependent (one class depends/uses another class)

    Specialized (one class is a subtype of another class)

    Packaged (grouped together as a unit package).

  • 7/28/2019 UMLMagicDraw

    8/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Class Diagram continue?

    A class diagram does not express anything specific about

    the relationships of a given object, but it does abstractly

    describe the potential relationships of one object to other

    objects.A class diagram is the logical map of your existing or

    future source code. FIG 1.0 BankAccount Class Diagram

    public class BankAccount {

    }

    BankAccount

    -acctId: String-balance: double

    +deposit(): void

    +withdraw(): double

    -calcInterest(): double

  • 7/28/2019 UMLMagicDraw

    9/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Class Diagram continue?class Bank {

    private String city;

    private int currentIndex=0;

    Privat BankAccount [ ] accounts;

    public void add() { }publicBankAccountgetAccount() { }

    }

    BankAccount

    -acctId: String-balance: double

    +withdraw(): void

    +deposit(): double

    -calcInterest(): double

    Bank

    -city: String

    -currentIndex:int

    -accounts: BankAccount

    +add(): void

    +getaccount(): BankAccount

  • 7/28/2019 UMLMagicDraw

    10/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Class Diagram continue?Createa class diagram

    All options associated with a class can be set in the Class

    Specification dialog box.

  • 7/28/2019 UMLMagicDraw

    11/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Object Diagram ?Classes represent types ofobjects that are handled in a

    system.The instances of those types (objects) are

    instantiated only on the runtime.

    BankAccount

    -acctId: String-balance: double

    +deposit(): void

    +withdraw(): double

    -calcInterest(): double

    myAccount

    -acctId: String

    -balance: 30.00

    +deposit(): void

    +withdraw(): double

    -calcInterest(): double

    Class Object

  • 7/28/2019 UMLMagicDraw

    12/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    State Diagram?Objects change their state as a request in executing amethod.. In general, The behavior of objects of a class

    can be described in terms of states and events, using a

    state machine connected to the class under construction.A State Machine is a specification of the sequence of

    states through which an object or an interaction goes in

    response to events during its life

    A State Diagram is a graph that represents a state machine

    .

  • 7/28/2019 UMLMagicDraw

    13/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Interface ?An interface is a specifier for the externally-visible

    operations of a class, component, or other classifier

    (including subsystems) without specification of internal

    structure. Each interface often specifies only a limited partof the behavior of an actual class.

    interface Creditchecker

    {

    }

    public class BankAccount implements CreditChecker

    {

    }

    interface

    Creditchecker

    BankAccount

  • 7/28/2019 UMLMagicDraw

    14/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Abstract classes ?In UML there are two ways to denote that a class or

    method is abstract. You can write the name in italics, or

    you can use the {abstract} property, both options are

    shown below:

    public abstract class Accounts

    {

    private String name;

    }

    Accounts

    name

    Accounts{abstract}

    name

  • 7/28/2019 UMLMagicDraw

    15/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Properties?Properties, like {abstract} can be added to any class, they

    represent extra information for the class, such as

    CustomerAccounts{author=ellie,

    Date=20050804,

    File=account.java,

    Private}

  • 7/28/2019 UMLMagicDraw

    16/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Association ?An Association between classes often represent instance

    variables that hold references to other objects.

    public class Bank

    {

    private BankAccount CustomersAccounts[100];

    }

    Bank BankAccount

    100

    CustomersAccounts

  • 7/28/2019 UMLMagicDraw

    17/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Inheritance ?An inheritance between classes often represent instance

    variables that hold references to other objects.

    public class BankAccount

    {

    }

    public class SavingAccount extends BankAccount

    {

    }

    public class CheckingAccount extends BankAccount

    {}

    BankAccount

    SavingAccount CheckingAccount

  • 7/28/2019 UMLMagicDraw

    18/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Override Operations ?Overriding Operation When you inherit classes from the

    base class, which has abstract functions, you have to

    redefine them in the inherited classes. The implement and

    override operations tool will help you generate operations

    that are defined as abstract in the base class.

    The command Implement/Override Operations command

    can be invoked in 2 cases:

    When one classifier inherits operations from the base

    classifier (Generalization relationship).

    When some classifier implements Interface (Realizationrelationship).

  • 7/28/2019 UMLMagicDraw

    19/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Override Operation continue ?To start the Implement/Override Operations toolFrom the shortcut menu of the selected class,

    choose Tools. Then, choose Implement/Override

    Operations. The Select Operations to Implement,

    Override dialog box appears.

  • 7/28/2019 UMLMagicDraw

    20/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    MagicDrawTools?MagicDrawprovides the following tools and wizards to help

    you perform the design tasks in your job quickly and easily: Reports prepares HTML, PDF, or RTF report documents describing the model.

    Class Diagram Wizard helps to create and customize new class diagrams.

    Package Overview Diagram Wizard generates the package dependency

    diagram for packages in your project.

    Tools for Analysis prepares diagrams and report documents of the

    relationships between classes in the UML model.

    Hierarchy Diagram Wizard

    Content Diagram Wizard- generates content of diagrams that are used in the project.

    Creating Setters / Getters creates getting and setting operators for attributes

    defined in the class. Helps in analyzing the class.

    Implementing or Overriding Operations creates defined operations down the

    inheritance tree. And more

  • 7/28/2019 UMLMagicDraw

    21/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    MagicDrawDemo?MagicDraw Basics demo : MD_viewlets_Basics.exeThis demo introduces the very basics of working with

    MagicDraw: shows how to create project and diagrams,

    outlines the main working environments, navigates through

    elements drawing and presentation options.

    Code Generation : MD90_viewlets_Codegeneration.exe

    This demo will show you how to perform codegeneration in the MagicDraw UML. You will get acquainted

    with source code generation from model and see how model

    changes are reflected in the code.

  • 7/28/2019 UMLMagicDraw

    22/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Information on MagicDraw?http://www.magicdraw.com

  • 7/28/2019 UMLMagicDraw

    23/23

    ACM/JETT Workshop - August 4-5, 2005

    UML Modeling using MagicDraw

    Appendix A.Process of software system modeling:Without UML:

    Define problem

    Go to whiteboard

    Draw high level boxes

    Draw flowcharts(show: behaviors and state diagram)

    Write High level Specification.

    Write functional specification(function name,parameters,..)

    Code

    Analyze

    Build Test

    With UML and UML tools such as MagicDraw:

    Define problem

    ..And use UML concept and tools such as MagicDraw to do the rest