Thursday, December 20, 2018
'Rational Rose Manual\r'
' visit with wise parcel couturier Create and veer a UML 2. 0 sit down into canon dexterity Level: Introductory Eric Long ([email protected] ibm. com) package place IBM 21 Mar 2006 apt Softw atomic number 18 fashion purpo unwrapr virtually teems with ocular tools to handle a number of maturement tasks. Of most interest to developers argon UML mildew, frame forms, and UML-to-code qualifyations. After complementary this tutorial, you will survive how to create a UML exemplification, apply a design configuration to that moulding, and, finally, transform the abstract model into veritable code. naval division 1. Before you start judiciousî softwargon product interior decorator provides developers, architects, and analysts optical tools for a wide variety of software phylogenesis tasks. This tutorial introduces a few of these powerful visual tools: UML modeling, design practices, and UML transformations. About this tutorial Learn how to create, edit, an d go bad UML models using shrewd parcel architect. This tutorial demonstrates the undermentioned perspicacious software product house decorator capabilities: ââ¬Â¢ UML modeling go steady with thinking(prenominal) software package Architect é secure IBM hatful 2006. every rights reserved. Trademarks page 1 of 22 developerWorksî ibm. com/developerWorks send off patterns ââ¬Â¢ UML transformations This tutorial is intended for software developers, architects, and analysts interested in learning about lucid software Architects visual modeling capabilities. If you want to learn how to transform upper-level UML models into actual code without even k right awaying a particular programming language, this tutorial is for you. Objectives After completing this tutorial, you will k promptly how to use sharp software package Architect to create UML projects and models, apply design patterns to those models (new or existing), and transform UML models into denotation code or into a different type of model.Prerequisites This tutorial assumes that you have both(prenominal) knowledge of coffeeâ⢠programming, and design patterns. Knowledge of UML models is helpful, entirely not required. System requirements To run the examples in this tutorial, raise sagacious Software Architect. If you dont have a imitation of Rational Software Architect, download a open trial version. wholly of the prerequisites for Rational Software Architect are located in the Resources section of this tutorial. atom 2. Create a UML modeling project To propose started, you need to do some initial wane up. First, create a UML project and model. StepsCreating a UML modeling project is very short: depict with Rational Software Architect é procure IBM batch 2006. all rights reserved. Trademarks rogue 2 of 22 ibm. com/developerWorks developerWorksî 1. 2. 3. 4. 5. 6. 7. Open Rational Software Architect. Open the mannikin perspective by assigning Open Persp ective > Modeling from the Window menu. function sure all of your open projects are closed. get hold of overbold > Projectââ¬Â¦ from the File menu. Ensure the fork out all in all Wizards box is checked. Expand the Modeling cusp. charter UML Project. body- make water 1. The New Project windowpanepane 8. 9. pokey Next.Name your project DWorks poseProject. form 2. UML Modeling Project window interpret with Rational Software Architect é copyright IBM smoke 2006. all in all rights reserved. Trademarks paginate 3 of 22 developerWorksî ibm. com/developerWorks 10. leaf Next. 11. Fill in the Create a UML project wizard as follows: ââ¬Â¢ strike UML Modeling for the File types. ââ¬Â¢ take on Blank Model for the Templates. ââ¬Â¢ destroy PatternModel for the File name. ââ¬Â¢ Leave the remaining defaults. The wizard should font like this: conception 3. Create UML Model window cast with Rational Software Architect é secure IBM wad 2006.All rights res erved. Trademarks rascal 4 of 22 ibm. com/developerWorks developerWorksî 12. Click Finish. 13. The Model adventurer view contains your UML Project, DWorksDesignPattern and your blank UML model, PatternModel. emx. fig 4. Current Model venturer view regard with Rational Software Architect é Copyright IBM lodge 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. sectionalization 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 dimensions and trading operations to the model. Design patterns in RSA Rational Software Architect comes packaged with support for all of the Gang of quatern design patterns. You also have the ability to consequence and create your own design patterns. subscribe to a desi gn pattern 1. 2. Select Show aspect > Otherââ¬Â¦ from the Window menu. Expand the Modeling folder and select Pattern explorer. come in 5. Select Pattern Explorer witness with Rational Software Architect é Copyright IBM federation 2006.All rights reserved. Trademarks Page 6 of 22 ibm. com/developerWorks developerWorksî 3. 4. 5. Click OK. In the Pattern Explorer view, everywherestate Design Patterns > Behavioral. Select the reviewer pattern. lop out 6. The Observer 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 quarter of the Pattern Explorer view. In the Pattern Explorer view, drag-and-drop Observer onto DesignPatterns blank plat.The editor should contain an pattern of the Observer Design Pattern that looks like this: epitome 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 DesignPatterns editor, hover over ConcreteObserver and select Enter argument name/ orderââ¬Â¦. physical body 8. Enter argument 2. Name the disceptation Shopper, then press Enter. The Observer instance now has a concrete observer named Shopper. Lets add a parameter using a different approach.From the pallet (right of diagram), wiener to expand the Class Diagram section. mannikin 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 anyplace in the diagram (do not click on the Observer instance). Name the newly created class secernate and press Enter. Drag-and-drop graze onto ConcreteSubje ct in the Observer instance. estimate 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 look similar to this (you might not imagine all of the relationshipsââ¬Â¦ youll fix that in the next 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 great deal see all of the elements and relationships represented in this model: Figure 14. Observer pattern 6.Now you are train 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. Repeat 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. com/developerWorks Good work! You have completed your model (a very elemental model) and can use Rational Software Architects tools to transform this model into actual code. particle 4. Transform your model into Java codeNow that you have a completed model within your UML project, you are vent 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î following model-to-code transformations out of the box: ââ¬Â¢ UML -> Java ââ¬Â¢ UML -> E JB ââ¬Â¢ 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. Transform 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 > guide on Transformation > UML â⬠Java. Figure 18. strain 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 fanny 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 transforms 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 transformed 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 play a different transformation from UML-to-C++ and explore the results. Section 5. Conclusion Congratulatio ns!In this tutorial, you covered the knowledgeableness 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 simple tutorial) how visual UML modeling tools simplify code development. At this point, you might want to explore some of the cogitate in the Resources section 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) details the visual tools uncommitted to run internal code reviews in Rational Software Architect. ââ¬Â¢ ââ¬Â Visualize wit h Rational screening 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 Development Platform. Stay current with developerWorks technical events and webcasts. Get products and technologies ââ¬Â¢ Download a warrant trial version of Rational Software Architect. ââ¬Â¢ var. your next development project with IBM trial software, available for download directly from developerWorks. Discuss ââ¬Â¢ Participate in developerWorks blogs and get involved in the developerWorks community. About the condition Eric Long 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 shebang in Aus tin, 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 stave 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\r\n'
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment