SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Introduction to Rational Rose 98i Module 11: RoseScript
Objectives:  RoseScript ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is RoseScript? ,[object Object],[object Object]
Uses of RoseScript ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How are Scripts Executed? ,[object Object],[object Object],[object Object],[object Object],[object Object]
How are RoseScript Classes Used? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
RoseApp ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
RoseScripts and Color ,[object Object],Keywords are in  blue Comments are in  green Code is in  red Everything else is black
Some “Basic” Terms ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some “Basic” Terms ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some “Basic” Terms ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Scripting Toolbar Cut Add Watch End Start Paste Procedure Step Calls Toggle Breakpoint Break Undo Copy Single Step
The Script Editor
Debugging Problems are highlighted in gray
Sample Script ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Viewport ,[object Object],[object Object],[object Object],[object Object]
Viewport Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scripting and Reports ,[object Object]
Print Package and Class Names Script 'The Main statement defines the subroutine where execution begins   Sub  Main  'Open the Viewport window Viewport.open 'Pass the current open model to the  DumpModel  subroutine  DumpModel RoseApp.CurrentModel 'End the subroutine End Sub
Print Package and Class Names Script ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Print Package and Class Names Script ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Print Package and Class Names Script ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Print Package and Class Names Script ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scripting and Business Problem Solutions ,[object Object],[object Object],[object Object],[object Object],A script can be written to change the names of all classes in the model to enforce naming conventions
Creating the Script ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Script Steps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Needed Script Functions  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Prefix Script '  Definition of the prefix Const   Prefix$   = "Rose98" Sub   Main ' Declare local variables Dim   theClasses   As   ClassCollection Dim  theClass  As  Class ' Set the class collection to all the classes in the  model Set   theClasses   =   RoseApp.CurrentModel.GetAllClasses ()
The Prefix Script ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Prefix Script ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scripting and Model Updates ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Script to Add a Package With One Class
Script to Add a Package With One Class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Script to Add a Package With One Class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise ,[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy CodeRowan Merewood
 
Clean code and refactoring
Clean code and refactoringClean code and refactoring
Clean code and refactoringYuriy Gerasimov
 
Javascript - Tutorial
Javascript - TutorialJavascript - Tutorial
Javascript - Tutorialadelaticleanu
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQLArti Parab Academics
 
8 introduction to_java_script
8 introduction to_java_script8 introduction to_java_script
8 introduction to_java_scriptVijay Kalyan
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java scriptDivyaKS12
 
Introduction to web programming with JavaScript
Introduction to web programming with JavaScriptIntroduction to web programming with JavaScript
Introduction to web programming with JavaScriptT11 Sessions
 
Decaf language specification
Decaf language specificationDecaf language specification
Decaf language specificationSami Said
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handlingSuite Solutions
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applicationschartjes
 

Was ist angesagt? (20)

Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
Lesson 4 constant
Lesson 4  constantLesson 4  constant
Lesson 4 constant
 
Clean code and refactoring
Clean code and refactoringClean code and refactoring
Clean code and refactoring
 
Effective PHP. Part 6
Effective PHP. Part 6Effective PHP. Part 6
Effective PHP. Part 6
 
Perl_Part5
Perl_Part5Perl_Part5
Perl_Part5
 
Web programming
Web programmingWeb programming
Web programming
 
Javascript - Tutorial
Javascript - TutorialJavascript - Tutorial
Javascript - Tutorial
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
 
Java script
Java scriptJava script
Java script
 
Java script
Java scriptJava script
Java script
 
Java script
Java scriptJava script
Java script
 
Java script basics
Java script basicsJava script basics
Java script basics
 
8 introduction to_java_script
8 introduction to_java_script8 introduction to_java_script
8 introduction to_java_script
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
 
Effective PHP. Part 4
Effective PHP. Part 4Effective PHP. Part 4
Effective PHP. Part 4
 
Introduction to web programming with JavaScript
Introduction to web programming with JavaScriptIntroduction to web programming with JavaScript
Introduction to web programming with JavaScript
 
Decaf language specification
Decaf language specificationDecaf language specification
Decaf language specification
 
Functions in PHP
Functions in PHPFunctions in PHP
Functions in PHP
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handling
 
Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
 

Andere mochten auch (6)

Clear case
Clear caseClear case
Clear case
 
JAX B
JAX BJAX B
JAX B
 
12report
12report12report
12report
 
Clear case
Clear caseClear case
Clear case
 
ClearCase 8.0
ClearCase 8.0ClearCase 8.0
ClearCase 8.0
 
ClearCase Basics
ClearCase BasicsClearCase Basics
ClearCase Basics
 

Ähnlich wie 11script

Introduction to Modern Perl
Introduction to Modern PerlIntroduction to Modern Perl
Introduction to Modern PerlDave Cross
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl TechniquesDave Cross
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldDavid McCarter
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perlmegakott
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpointwebhostingguy
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl TechniquesDave Cross
 
Perl Teach-In (part 1)
Perl Teach-In (part 1)Perl Teach-In (part 1)
Perl Teach-In (part 1)Dave Cross
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]srikanthbkm
 
Demystifying Object-Oriented Programming - PHP[tek] 2017
Demystifying Object-Oriented Programming - PHP[tek] 2017Demystifying Object-Oriented Programming - PHP[tek] 2017
Demystifying Object-Oriented Programming - PHP[tek] 2017Alena Holligan
 
PHP OOP Lecture - 02.pptx
PHP OOP Lecture - 02.pptxPHP OOP Lecture - 02.pptx
PHP OOP Lecture - 02.pptxAtikur Rahman
 
Effective Java with Groovy - How Language Influences Adoption of Good Practices
Effective Java with Groovy - How Language Influences Adoption of Good PracticesEffective Java with Groovy - How Language Influences Adoption of Good Practices
Effective Java with Groovy - How Language Influences Adoption of Good PracticesNaresha K
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationMohammed Farrag
 

Ähnlich wie 11script (20)

Introduction to Modern Perl
Introduction to Modern PerlIntroduction to Modern Perl
Introduction to Modern Perl
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
 
Bioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperlBioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperl
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perl
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
 
Perl Teach-In (part 1)
Perl Teach-In (part 1)Perl Teach-In (part 1)
Perl Teach-In (part 1)
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]
 
Demystifying Object-Oriented Programming - PHP[tek] 2017
Demystifying Object-Oriented Programming - PHP[tek] 2017Demystifying Object-Oriented Programming - PHP[tek] 2017
Demystifying Object-Oriented Programming - PHP[tek] 2017
 
Scala presentationjune112011
Scala presentationjune112011Scala presentationjune112011
Scala presentationjune112011
 
Bioinformatica 27-10-2011-p4-files
Bioinformatica 27-10-2011-p4-filesBioinformatica 27-10-2011-p4-files
Bioinformatica 27-10-2011-p4-files
 
Os Secoske
Os SecoskeOs Secoske
Os Secoske
 
PHP OOP Lecture - 02.pptx
PHP OOP Lecture - 02.pptxPHP OOP Lecture - 02.pptx
PHP OOP Lecture - 02.pptx
 
Effective Java with Groovy - How Language Influences Adoption of Good Practices
Effective Java with Groovy - How Language Influences Adoption of Good PracticesEffective Java with Groovy - How Language Influences Adoption of Good Practices
Effective Java with Groovy - How Language Influences Adoption of Good Practices
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administration
 
Ruby - Design patterns tdc2011
Ruby - Design patterns tdc2011Ruby - Design patterns tdc2011
Ruby - Design patterns tdc2011
 
Best practices tekx
Best practices tekxBest practices tekx
Best practices tekx
 

Mehr von Nguyen Tran

Mehr von Nguyen Tran (20)

Se 06
Se 06Se 06
Se 06
 
10team
10team10team
10team
 
09componentdeployment
09componentdeployment09componentdeployment
09componentdeployment
 
08activity
08activity08activity
08activity
 
07state
07state07state
07state
 
06collaboration
06collaboration06collaboration
06collaboration
 
05sequence
05sequence05sequence
05sequence
 
04class
04class04class
04class
 
03usecase
03usecase03usecase
03usecase
 
02intro
02intro02intro
02intro
 
01about
01about01about
01about
 
Business process excution language
Business process excution languageBusiness process excution language
Business process excution language
 
Vs doc man
Vs doc manVs doc man
Vs doc man
 
Cm mi
Cm miCm mi
Cm mi
 
Sql packager
Sql packagerSql packager
Sql packager
 
Snag it
Snag itSnag it
Snag it
 
Record mydesktop
Record mydesktopRecord mydesktop
Record mydesktop
 
Rational suite&rational rose enterprise
Rational suite&rational rose enterpriseRational suite&rational rose enterprise
Rational suite&rational rose enterprise
 
Umodel 2009
Umodel 2009Umodel 2009
Umodel 2009
 
Rational composer method
Rational composer methodRational composer method
Rational composer method
 

11script

  • 1. Introduction to Rational Rose 98i Module 11: RoseScript
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. The Scripting Toolbar Cut Add Watch End Start Paste Procedure Step Calls Toggle Breakpoint Break Undo Copy Single Step
  • 14. Debugging Problems are highlighted in gray
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Print Package and Class Names Script 'The Main statement defines the subroutine where execution begins Sub Main 'Open the Viewport window Viewport.open 'Pass the current open model to the DumpModel subroutine DumpModel RoseApp.CurrentModel 'End the subroutine End Sub
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. The Prefix Script ' Definition of the prefix Const Prefix$ = "Rose98" Sub Main ' Declare local variables Dim theClasses As ClassCollection Dim theClass As Class ' Set the class collection to all the classes in the model Set theClasses = RoseApp.CurrentModel.GetAllClasses ()
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.

Hinweis der Redaktion

  1. To open an existing script Select the Tools:Open Script menu command. Click to select the name of the script. Click the Open button. To create a new script Select the Tools:New Script menu command.
  2. To run a script interactively Create a new script or open an existing script. Click the Start button (green triangle). To save a script in compiled form Create a new script or open an existing script. Select the Debugger:Compile menu command. Enter the name of the compiled script. Click the Save button.
  3. Main() is the first procedure to execute no matter where it is located in the script.
  4. This script may be found on your Course Exercise Models disk. It is called “Print Packages and Class Names.ebs”.
  5. A script can be written to change the names of all classes in the model to enforce naming conventions.
  6. This script may be found on your Course Exercise Models disk. It is called “Prefix.ebs”.
  7. This script may be found on your Course Exercise Models disk. It is called “Add Package with One Class.ebs”.
  8. The solution script may be found on your Course Exercise Models disk. It is called “Add Package with Multiple Classes.ebs”.