.

Thursday, February 21, 2019

Rational Rose Manual

jut with cerebral parcel house decorator effect and exchange a UML 2. 0 model into code Skill Level Introductory Eric coherent (emailprotected ibm. com) package Engineer IBM 21 Mar 2006 able softw are system couturier virtu aloney teems with visual tools to handle a number of development tasks. Of intimately interest to developers are UML border, origination patterns, and UML-to-code transformations. After completing this tutorial, you will cheat how to create a UML model, exercise a normal pattern to that model, and, finally, transform the abstract model into literal code. Section 1. Before you start coherent computer software interior proposeer provides developers, architects, and analysts visual tools for a wide variety of software development tasks. This tutorial introduces a few of these powerful visual tools UML modeling, design patterns, and UML transformations. About this tutorial Learn how to create, edit, and analyze UML models using sensible Software interior decorator. This tutorial demonstrates the adjacent coherent Software room decorator capabilities UML modeling Visualize with thinking(prenominal) Software house decorator right of first publication IBM familiarity 2006. both rights reserved. Trademarks rascal 1 of 22 developerWorks ibm. com/developerWorks intent patterns UML transformations This tutorial is intended for software developers, architects, and analysts interested in eruditeness about keen Software fashion designers visual modeling capabilities. If you essential to examine how to transform high-level UML models into genuine code without in time feeling a furcateicular programming language, this tutorial is for you. Objectives After completing this tutorial, you will know how to use intelligent Software Architect to create UML contrives and models, apply design patterns to those models (new or existing), and transform UML models into source code or into a divergent type of model.Prerequis ites This tutorial assumes that you have almost knowledge of umber programming, and design patterns. Knowledge of UML models is helpful, but not required. System requirements To run the examples in this tutorial, instal Rational Software Architect. If you dont have a copy of Rational Software Architect, download a big trial version. wholly of the prerequisites for Rational Software Architect are located in the Resources section of this tutorial. Section 2. Create a UML modeling project To get started, you need to do some initial set up. First, create a UML project and model. StepsCreating a UML modeling project is very easy Visualize with Rational Software Architect copyright IBM friendship 2006. All rights reserved. Trademarks Page 2 of 22 ibm. com/developerWorks developerWorks 1. 2. 3. 4. 5. 6. 7. sacrifice Rational Software Architect. rough the exemplar perspective by selecting Open Perspective poseing from the Window menu. Make sure all of your opened projects are closed. take in forward- numbering endure from the File menu. Ensure the plant All Wizards box is checked. fatten out the feigninging folder. Select UML Project. lick 1. The untried Project window 8. 9. Click Next. disclose your project DWorks strainProject. prefigure 2. UML Modeling Project window Visualize with Rational Software Architect secure IBM smoke 2006. All rights reserved. Trademarks Page 3 of 22 developerWorks ibm. com/developerWorks 10. Click Next. 11. Fill in the Create a UML project wizard as follows Select UML Modeling for the File types. Select Blank Model for the Templates. cipher PatternModel for the File name. put across the remaining defaults. The wizard should look like this Figure 3. Create UML Model window Visualize with Rational Software Architect Copyright IBM potentiometer 2006.All rights reserved. Trademarks Page 4 of 22 ibm. com/developerWorks developerWorks 12. Click Finish. 13. The Model adventurer watch applys your UML Project, DWorksDesignPattern and your blank UML model, PatternModel. emx. Figure 4. Current Model venturer view Visualize with Rational Software Architect Copyright IBM community 2006. All rights reserved. Trademarks Page 5 of 22 developerWorks ibm. com/developerWorks See, wasnt that easy? Now, on to the more exciting part of the tutorial. Lets build the model using RSAs user-friendly visual tools. Section 3. Model a design patternNow its time to select a design pattern, apply that design pattern to a model, observe all relationships of the pattern, and add attributes and operations to the model. Design patterns in RSA Rational Software Architect comes packaged with uphold for all of the Gang of Four design patterns. You also have the powerfulness to import and create your own design patterns. Select a design pattern 1. 2. Select Show View Other from the Window menu. Expand the Modeling folder and select Pattern explorer. Figure 5. Select Pattern explorer Visualize with Rational Sof tware Architect Copyright IBM community 2006.All rights reserved. Trademarks Page 6 of 22 ibm. com/developerWorks developerWorks 3. 4. 5. Click OK. In the Pattern Explorer view, expand Design Patterns Behavioral. Select the beholder pattern. Figure 6. The beholder Design Pattern Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 7 of 22 developerWorks ibm. com/developerWorks 6. 7. 8. To learn about the pattern, on-off switch between the Overview and Short Description tabs at the bottom of the Pattern Explorer view. In the Pattern Explorer view, drag-and-drop reviewer onto DesignPatterns blank diagram.The editor should contain an instance of the commentator Design Pattern that looks like this Figure 7. Observer Pattern Instance Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 8 of 22 ibm. com/developerWorks developerWorks Apply a design pattern 1. In D esignPatterns editor, hover over ConcreteObserver and select Enter argument name/value. Figure 8. Enter argument 2. Name the parameter Shopper, then press Enter. The Observer instance now has a cover observer named Shopper. Lets add a parameter using a several(predicate) approach.From the Palette (right of diagram), mouse click to expand the Class Diagram section. Figure 9. Palette 3. Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 9 of 22 developerWorks ibm. com/developerWorks 4. 5. 6. Select Class and click anywhere in the diagram (do not click on the Observer instance). Name the newly created furcate Order and press Enter. Drag-and-drop Order onto ConcreteSubject in the Observer instance. Figure 10. Drag-and-drop ConcreteSubject Visualize with Rational Software Architect Copyright IBM Corporation 2006.All rights reserved. Trademarks Page 10 of 22 ibm. com/developerWorks developerWorks 7. Your diagram should loo k exchangeable to this (you might not see all of the relationships youll fix that in the side by side(p) section). Figure 11. Observer instance Observe the design pattern relationships 1. Right-click on any element in the DesignPattern diagram. Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 11 of 22 developerWorks ibm. com/developerWorks 2. Select Filters Show Related Elements from the context menu.Figure 12. Show relationships 3. Select Show All Relationships from the Custom Query list. Figure 13. Show/Hide Relationships Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 12 of 22 ibm. com/developerWorks developerWorks Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 13 of 22 developerWorks ibm. com/developerWorks 4. 5. Click OK You bay window see all of the elements and relationships repres ented in this model Figure 14. Observer pattern 6.Now you are ready to add some elements to your blank Observer design pattern model. Add methods and attributes to a model Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 14 of 22 ibm. com/developerWorks developerWorks 1. 2. In the PatternModel editor, right-click the Order concrete subject. Select Add UML attribute. Figure 15. Add attribute 3. 4. 5. 6. 7. 8. 9. Type -orderNum String (the - makes the attribute private). Press Enter. iterate the same steps on Shopper, but name the attribute -custID String.In the PatternModel editor, right-click the Shopper concrete subject. Select Add UML operation. Type +makeOrder() (the + makes the operation public). PatternModels editor should now look like this Figure 16. Observer pattern Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 15 of 22 developerWorks ibm. c om/developerWorks Good work You have accomplished your model (a very uncomplicated model) and can use Rational Software Architects tools to transform this model into actual code. Section 4. transfigure your model into Java codeNow that you have a completed model within your UML project, you are going to transform that model to actual code. Rational Software Architect supports the Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 16 of 22 ibm. com/developerWorks developerWorks pastime model-to-code transformations out of the box UML - Java UML - EJB UML - XSD UML - CORBA UML - C++ However, if you would like more options, there are built-in tools and wizards that let you create custom transformations in Rational Software Architect.You are going to transform your existing model into Java. diversify a UML model to Java code 1. In the Model Explorer view, expand DWorksPatternProject. Figure 17. Expanded project 2. 3. In the Model Explorer view, select both Order and Shopper. Right-click on either of the selected objects and select Transform Run Transformation UML Java. Figure 18. Run transformation Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 17 of 22 developerWorks ibm. com/developerWorks 4.In the Run this Transformation window, click Create new hindquarters Container. Figure 19. Transformation window Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 18 of 22 ibm. com/developerWorks developerWorks 5. In the New Java Project window, name the project DWorksTransformedJava. Figure 20. New Java project Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 19 of 22 developerWorks ibm. com/developerWorks 6. 7. Click Finish.Now that you are back in the Run this Transformation window, click Run. RSA transform s the model into Java source code. The Model Explorer view should contain this Java project Figure 21. Transformed Java project 8. Double-click Order. java to see the modify code. The code should look like this Figure 22. Transformed Order class Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 20 of 22 ibm. com/developerWorks developerWorks Try running a different transformation from UML-to-C++ and explore the results. Section 5. Conclusion CongratulationsIn this tutorial, you cover the creation of a UML project and model, selecting and applying a design pattern to a model, adding and editing attributes and operations to a model, and transforming that model into actual code. You did all of this without even writing a line of code It is easy to see (even with this mere(a) tutorial) how visual UML modeling tools simplify code development. At this point, you might want to explore some of the links in the Resources sectio n of this tutorial. Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 21 of 22 developerWorks ibm. om/developerWorks Resources Learn Visit the developerWorks Rational zone to expand your Rational skills. Exposing Design flaws in your code Part 1 (developerWorks, August 2005) elaborate the visual tools available to run internal code reviews in Rational Software Architect. Visualize with Rational Application Developer (developerWorks, February 2006) details the visualization capabilities of Rational Application Developer. Discover IBM Rational visual tools for application development (developerWorks, February 2006) covers all of the different visual tools available in the Rational Software knowledge Platform. Stay current with developerWorks technical events and netcasts. Get products and technologies Download a free trial version of Rational Software Architect. Build your next development project with IBM trial software, available for download directly from developerWorks. Discuss move in developerWorks blogs and get involved in the developerWorks community. About the author Eric grand Eric Long is a Software Engineer in the IBM Developer Skills Program. Eric graduated from The University of Texas with a degree in Computer Science.He joined IBM in July of 2004 and currently whole kit and caboodle in Austin, Texas. As a Software Engineer, he provides technical information to developers on open source and industry trends and technologies through speaking engagements, web content, and faculty consultations at IBM Academic Initiative member universities. His work also includes technical courses, demos, articles, and tutorials available at http//www. ibm. com/university and http//www. ibm. com/developerworks. Visualize with Rational Software Architect Copyright IBM Corporation 2006. All rights reserved. Trademarks Page 22 of 22

No comments:

Post a Comment