000-256 Rational

000-256 Rational
000-256 Rational

Exam : 000-256

Title : Application Development with IBM Rational Application Developer for WebSphere Software Ver : 01.24.07

QUESTION 1:

A developer wants to test an application with the default WebSphere Test Environment. The application uses Message driven Beans and JMS API. In order to test the application successfully, what does the developer need to do, if anything?

A. Connect to the integrated Server using the admin console and enable the messaging engine.

B. Install WebSphere MQ on the machine and configure the Test Environment resources to point to the external JMS server since the Test Environment does not support the messaging engine.

C. Install the Embedded Messaging feature

D. Do no extra configuration, because the integrated Server environment comes with the messaging engine enabled.

Answer: A

QUESTION 2:

Which TWO of the following artifacts will be included in an Application Client

JAR?

A. Deployment descriptor

B. EJBs

C. Java classes

D. Servlets

Answer: A,C

QUESTION 3:

Which of the following statements is TRUE with respect to an Enhanced EAR?

A. It is part of the J2EE 1.4 specification

B. It is a combination of multiple enterprise applications

C. It simplifies the deployment

D. It is available only in Rational Application Developer V6 Test Environment Answer: C

QUESTION 4:

A developer needs to test an application in the WebSphere Test Environment. If the application needs a JDBC data source, which TWO of the following configuration steps are always required?

A. Create a JDBC Provider

B. Specify the isolation policy

C. Specify the database name

D. Specify the minimum pool size.

Answer: A,C,

QUESTION 5:

A tester launches a Profile run configuration against a local executable Java class, receiving a message saying "Connection failed on localhost". The Agent Controller is installed. A possible cause for the error is that:

A. The network adapter on the localhost is disabled.

B. The Profile run configuration is configured to deny access to localhost.

C. The Agent Controller is configured to deny access to localhost

D. Local profiling was not specified in the Profile run configuration.

Answer: C

QUESTION 6:

An application that includes several message-driven beans is imported via Project Interchange. What if anything must be done before testing?

A. Configure JMS resources through the Deployment tab of the WebSphere enhanced EAR editor.

B. Open the server admin console and configure JMS resources

C. Deploy the JMS configuration and add it to the application.

D. Do nothing because the correct configuration is set up when the application is imported.

Answer: B

QUESTION 7:

A developer had configured and successfully tested WebSphere Test Environment

to monitor TCP/IP traffic between the browser and the test server using the default ports and values. After restarting, the browser shows the message "The page cannot be displayed". What is the probable reason for this?

A. After each restart, the TCP/IP monitor must be reconfigured

B. The "Show the TCP/IP Monitor view when there is activity" box be selected in TCP/IP Monitor setup screen.

C. The TCP/IP Monitor needs to be restarted after restart.

D. The incorrect port number was used (9080 instead of 9081) in the URL at the time the application was invoked.

Answer: C

QUESTION 8:

If a developer is using the Web service wizard to create a WS-I Complaint Web

service from a JavaBean, which of the following options needs to be selected?

A. RPC/Literal

B. RPC/Encoded

C. Document/Literal

D. Document/Encoded

Answer: C

QUESTION 9:

When using the Web Service wizard to generate a Web service from a JavaBean,

which TWO of the following options needs to be selected in order to test the newly created Web service?

A. Generate a JavaBean client proxy.

B. Test the Web service

C. Enable the TCP/IP Monitor server

D. Enable the Web Service Test Client

Answer: A,B

QUESTION 10:

A developer did not enerate sample JSPs that contain TestClient.jsp TO TEST THE Web services client implementation. How can the developer create sample JSPs

alone without disturbing the contents that were already generated?

A. Right click on any of the Java proxy classes, and select Generate Web Services from the context menu.

B. Right click on any of the Java proxy classes, and select Generate sample JSPs from the context menu.

C. Right click on WSDL file, and select Web services -> Generate sample JSPs from the context menu.

D. Right click on web.xml, and Select Generate sample JSPs from the context menu. Answer: B

QUESTION 11:

What is the BEST approach to avoid repeated manual data field entry while testing

a We

b service with Web Services Explorer?

A. Copy and paste the sequential data entries into a text file. Use the import Wizard to launch it in the Web Services Explorer.

B. Use the Source link to save the data entries as a SOAP message. Use the Load link to restore the entries before each test.

C. Set the filed values in the project's Web Services default Source preferences.

D. Export an automation script from the service WSDL file. Enter the input filed values into the script and then use the import Wizard to execute it.

Answer: B

QUESTION 12:

A developer create a Web service. The client side artifacts will be developed by a different team. What steps should a developer take to test the implementation quickly?

A. Test the Web services using TCP/IP monitor

B. Test the implementation using the WSDL file with the UDDI Explorer.

C. Test the implementation using the WSDL file with the Web services Explorer.

D. Test the implementation using the WSDL file with JUnit.

Answer: C

QUESTION 13:

If a WSDL file requires another WSDL file that exists outside the workspace, which

of the following actions should a developer take?

A. Add a WSDL import element to the WSDL file using the WSDL editor.

B. Import the WSDL file into the workspace and drag and dop it into the other WSDL file.

C. Use the XML editor to import the WSDL file into the workspace.

D. Merge both WSDL documents using the WSDL editor.

Answer: A

QUESTION 14:

Which of the following is the BEST approach to provide client-side artifacts for an EJB?

A. Export the EJB project as an EJB JAR.

B. Export the EJB client project as an EJB JAR.

C. Export the EJB project as a JAR.

D. Export the EJB client project as Ajar.

Answer: D

QUESTION 15:

The BEST way to remove an interface implementation from a session bean is to:

A. Delete the files that implement that interface from the Navigator view.

B. Open the Source tab of the EJB Deployment Descriptor and delete the references to this interfaces.

C. Remove the BeanName from Bean-type tab of the EJB Deployment Descriptor.

D. Remove the bean from the Bean tab of the EJB Deployment Descriptor and select Delete Deploy Code.

Answer: D

QUESTION 16:

Which TWO of the following are techniques for creating Entity Beans from an existing database schema?

A. Create a database connection from the Database Explorer view and copy the connection to an EJB project to generate Entity Beans.

B. Create a database connection from the Database Explorer view and create Entity Beans for a table in a schema.

C. Create an EJB to RDB bottom-up mapping inside an existing EJB project

D. Create an Entity Bean using the new EJB wizard and specify a database schema when defining the Entity Bean.

Answer: B,C

QUESTION 17:

A developer is re-writing a legacy relational database application using J2EE technologies. The developer has already implemented the CMP EJBs. The BEST

way to create the mapping is to use:

A. Top-down mapping

B. Bottom-up mapping

C. Meet-in-the-middle mapping

D. Custom mapping

Answer: C

QUESTION 18:

A developer wants to create a session bean that inherits from another session bean. Which of the following can the developer do?

A. Create the child session bean. Then create the parent session bean, making it the supertype of the child.

B. Create both session beans from the create an Enterprise Bean wizard. Then bring up the Properties dialog of the child session bean and select the parent.

C. Create both session beans from the Create an Enterprise Bean wizard. Then specify the parent of the child session bean in the deployment descriptor.

D. Create the parent session bean. Then create the child session bean, specifying the parent session bean.

Answer: D

QUESTION 19:

Using the Universal Test Client, a developer can test which of the following?

A. JSPs

B. EJBs

C. JavaBeans

D. Servlets

Answer: B

QUESTION 20:

Developers can specify the workspace they want to use by doing which TWO of the following?

A. Select a specific workspace directory while launching the application

B. Open a command prompt, navigate to the workspace directory and launch the application

C. Change the default workspace directory in the preferences

D. Use the -data argument when launching the application.

Answer: A,D

QUESTION 21:

A developer has made multiple changes to a class using multiple saves, but now

wants to undo all of them. What is the BEST way to revert to the original version?

A. Use the "Compare With -> Latest from Head" feature to identify the changes between the current state of the class and the original state and then make those changes.

B. Use the Replace With -> Previous from Local history" feature to replace the current version with that of the original version

C. Use the "Replace With -> Local history" feature to replace the current version with that of the original version

D. Review each line of code in the class and undo the changes that were made. Answer: C

QUESTION 22:

An EJB project has been exported to destination "File system". The resources must

be added to a new workspace. Which of the following solutions will add the resources to the workspace with no errors, assuming there are no dependent resources?

A. Create a new EJB project. Select "import -> system", browse to the location of the exported project, select it and choose "Create only selected directories".

B. Create a new EJB project. Select "import -> system", browse to the location of the exported project, select it and choose "Filter Types..." to choose the folder structure.

C. Select "import -> File system", browse to the location of the exported project, select it and check "Create new EJB folder". The project will be create in the workspace.

D. Select "import -> File system", browse to the location of the exported project, select it An options dialog will appear, allowin a choice of folder structure in the workspace. Answer: A

QUESTION 23:

A developer customizes the Web perspective by rearranging the views. To make

sure this customization is available after Rational Application DEVELOPER CLOSES, the BEST action for the developer to take is to:

A. Load the perspective from local history

B. Reset the perspective and rearrange the views on every startup.

C. Save the current perspective with a unique name.

D. Save the current perspective as a fast view.

Answer: C

QUESTION 24:

A developer wants to completely remove perspective from a given workspace. The

perspective was saved previously but is no longer used. Which of the following is the BEST way for the developer to accomplish this?

A. Open a new workspace

B. Use the Preferences dialog to remove the perspective

C. Use the Customize Perspective dialog to remove the perspective

D. Close the perspective

Answer: B

QUESTION 25:

A developer notices errors in the Problems view indicating that references to classes

and interfaces cannot be resolved. What is the MOST likely cause of the error?

A. A necessary JAR dependency is not available

B. The main class reference is not available

C. Unnecessary JAR files are referenced.

D. The client project is no longer associated with an Enterprise Application

Answer: A

QUESTION 26:

What must be done in order to use a logical name for an EJB home interface?

A. A message destination mapping must be performed to relate the logical name to the actual home of the EJ

B.

B. An EJB reference to the EJB module must be created using the Add Reference wizard.

C. The EJB must exist and a reference defined using the EJB deployment descriptor editor.

D. The EJB client must dereference the logical name prior to invoking methods on the home interface.

Answer: C

QUESTION 27:

A developer is using a Web Diagram to design a Struts application. Which TWO of

the following Struts parts are available on the palette?

A. Action Class

B. Action Mapping

C. ActionForm

D. Struts Module

Answer: B,C

QUESTION 28:

Which of the following CANNOT be added or removed in the Filters Page of the

Web Deployment Descriptor?

A. Filters

B. Filer mappings to other Filters

C. Filter mappings to Servlets

D. Filter initialization parameters

Answer: B

QUESTION 29:

Which TWO of the following statements are TRUE about custom tag library usage? A. The Application Deployment Descriptor can contain taglibdirectives that maps each JSP to the actual TLD file.

B. The Application Deployment Descriptor can contain a element containing a that maps the URI to the actual TLD file.

C. The WebDeployment Descriptor can contain a with a that maps the URI to the actual TLD file.

D. The serves as an alias for the TLD file that will be published as

WEB-INF/talib.tld.

Answer: B,C

QUESTION 30:

To add server side Java and client side JavaScript to handle user events in a JavaServer Faces (JSF) page, the developer should:

A. Use the Quick edit view to select the event and add code.

B. Use the generated class to add both Java and JavaSript event code.

C. Add a JavaBean to both the Page Data and Client Data view.

D. Create Java Action classes for server side events and JavaScript files for client side events and include them in the JSF page.

Answer: A

QUESTION 31:

Using Page Designer, a developer can cause an event to occur upon a button click on

a JSP by associating an:

A. onClick event with the button on the Design page.

B. onClick event with the button on the Source page.

C. onChange event with the button on the Preview page.

D. onChange event with the button on the Design page.

Answer: A

QUESTION 32:

A developer created a static Web project and imported all the resources.

Afterwards, the developer realizes that, in addition to static resources, there are dynamic resources such as JSP pages. What is the BEST way to correct the

situation?

A. Use the "Convert to a Dynamic Web project" option to convert the static project to a dynamic project.

B. Create a dynamic Web project and move all the resources to the new project.

C. Create a dynamic Web project and move only the dynamic resources to the new project

D. Create a Java project and a dynamic Web project, then move the utility jars to the Java project and the dynamic resources to the dynamic web project.

Answer: A

QUESTION 33:

A developer uses a singleton class in a Web application configuration parameters

and system resources. The configuration parameters are frequently altered by the

Web application components during runtime. Which of the following breakpoints is BEST suited to help the developer trace the value of such configuration parameters

and determine how they are Getting altered?

A. Java Exception

B. Conditional

C. Load

D. Watch

Answer: D

QUESTION 34:

A developer is debugging a problem and needs to display the value of a variable. However, the show details pane is displaying the class name and not the value. The developer needs to:

A. Toggle the variables display from class to value.

B. Check for a to String method for that class.

C. Use the pop-up inspector to evaluate the reference.

D. Change the type of the variable from reference to primitive.

Answer: B

QUESTION 35:

After running the Code Review on a module a developer wants to find all of the problems, warnings and recommendations associated with a particular file. What

are TWO approaches available to the developer?

A. Exclude other files from the project by applying exclusion filters in Project properties -> Java Build Path-> Source.

B. Select Code Review from the context menu for the file in the Package Explorer view.

C. Select the file from the sort By Files list in the Code Review view.

D. Select the Category from the Manage Rules page in the Code Review view. Answer: B,C

QUESTION 36:

A developer needs to use the same set of logs repeatedly with the Log and Trace Analyzer. The BEST way to do this is to:

A. Use the default log set to import logs with the import wizard

B. Correlate the log files using the Lo Correlation wizard.

C. Customize the log using common base events in workbench preferences.

D. Sort and filter the log records in the log view.

Answer: A

QUESTION 37:

An application stops at a breakpoint in a main ( ) method in com.package1.Class1. Using only the "Step into" button, the debug editor shows

com.package2.Class2.test1() but never returns to the main ( ) method. What is the problem?

A. There is a step filter set for com.package1.*

B. There is a step filter set for both com.package1.* and com.package2.*.

C. There is a step filter set for com.package2,* so the debugger cannot return the calling method.

D. A step filter needs to be set on order to allow the debugger to open methods in the

com.ibm package.

Answer: A

QUESTION 38:

A JUnit test is run, and it is anticipated that there will be information in the JUnit

view. Why is the view not visible?

A. Preference to show the view when there is information to display is set=NO; errors in the execution =YES

B. Preference to show the view when there is information to display is set=YES; errors in in the execution

=YES

C.Perference to show the view when there is information to display is set=NO; errors in the execution= NO;

D.Perference to show the view when there is information to display is set=YES; errors in

in the execution =YES

Answer: D

QUESTION 39:

Which of the following statements is TRUE about setting up Java Project. The

project can:

A. Customize the JRE extension folder libraries in the target JVM.

B. Have multiple source folders but only one output folder.

C. Have multiple source folders and multiple output folders

D. Generate class files for source files with compiler errors.

Answer: B

QUESTION 40:

A developer is viewing the code for a method and wants to find out what other

methods in the project call it. After focusing on the method, what actions should the

developer take in the Call Hierarchy view?

A. Click the Show Callee Hierarchy button, set the Search Scope to project and refresh

the view.

B. Click the show caller Hierarchy button, set the Search Scope to project and refresh the

view.

C. Select the project in the project Navigator view and click the show callee Hierarchy

button.

D. Select the project in the Project Navigator view and click the Show Caller Hierarchy

button.

Answer: B

QUESTION 41:

A developer notices a recurring code pattern in the source code and wants to make

it easier to type this coding pattern. The BEST way to accomplish this is to:

A. Create a template for the pattern using the Java preferences. This pattern can be used by the content-assist function of the Java editor.

B. Create a method with appropriate arguments if necessary containing this coding pattern.

C. Create a class containing coding patterns, which can be copied and pasted when required.

D. Add a bookmark on the occurrence of this coding pattern and use the Bookmarks view to retrieve and use the coding pattern.

Answer: A

QUESTION 42:

The UML Visual editor shows which TWO of the following relationship?

A. Inheritance

B. Realization

C. Composition

D. Aggregation

Answer: A,B

QUESTION 43:

When the "Refactor -> Change Method Signature" dialog is selected a developer

can do all of the following EXCEPT:

A. Change the parameters passed in the signature of the method that is currently selected.

B. Change all the references to the method by adding/deleting parameters.

C. Add a parameter to the signature and specify what value to pass to the parameter for each reference to the method.

D. Add a parameter to the signature and specify one default value to be passed in all references.

Answer: C

QUESTION 44:

A developer has written a method in one class and determines that another class requires the same behavior. The two classes share a common superclass. The BEST solution is to:

A. Use the Refactor -> Extract Method wizard to extract the method to the superclass.

B. Use the Refernce -> Extract Interface wizard to extract the method to the supercalss

C. Use the Refactor -> Pull Up wizard to move the method up the superclass

D. Use the Refactor -> Use Supertype Where Possible wizard to move the method up to superclass.

Answer: C

QUESTION 45:

A developer wants to search for text in a particular project. After selecting the

Project in the Package Explorer view, the developer could do which TWO of the following?

A. Select *Edit -> find/replace" to search

B. Select Search and use the Java Search tab.

C. Select Search and use the File Search tab, and set the Scope to Enclosing Projects.

D. Select Search and use the File Search tab, and set the Scope to a workset includes the project.

Answer: B,C

QUESTION 46:

A J2EE development team is developing two enterprise applications consisting of Servlet, JSP, HTML pages, images, java classes, EJBs with CMP and MDB. Java classes are common to both the applications. What is the BEST way to architect

these components?

A. Create a third enterprise application project to keep common Java classes. Add this common EAR as a dependent EAR to each enterprise application above.

B. Create a standalone Java project to keep common Java classes. Add stand alone module as utility JAR to the enterprise application projects (EARs.)

C. Keep common Java classes in each EAR file for better maintenance and reviewing

D. Add a standalone EJB project to keep common Java classes. Add stand alone EJB module as utility JAR to the enterprise application projects (EARs).

Answer: B

QUESTION 47:

Which of the following statements is TRUE about a Web application developed

using the JSP Model 2 architecture?

A. A browser sends the request to a JSP, and a JSP sends the response back to the

browser.

B. A filter instantiates a JavaBean and forwards the request to a JSP.

C. A Servlet instantiates a JavaBean and forwards the request to a JSP.

D. A JSP instantiates a JavaBean and sends the response back to a browser. Answer: C

QUESTION 48:

A Servlet doGet ( ) method in a small Webapplication acquires a javax.sql DataSource through a JNDI naming lookup. The BEST approach for improving scalability Servlet is to acquire the:

A. Reusable data connection pool instead of a JNDI DataSource.

B. DataSource in the Servlet init ( ) method and then cache it in an instant variable for subsequent use.

C. DataSource in the Servlet service ( ) method and then cache it in the HttpSession for subsequent use.

D. InitialContextFactory in the Servlet service ( ) method and cache it in a hidden input field for subsequent use.

Answer: B

QUESTION 49:

Which TWO of the following guidelines will help improve the performance of a

J2EE application?

A. Do not store large object graphs in the HTTP session

B. Create fine rained session beans to access entity bean attributes

C. Close all unused JDBC resources such as connections, statements and result sets.

D. Rely on WebSphere Application Server to remove unused session attributes. Answer: A,C

QUESTION 50:

In accordance with application development best practices, syntactic server-side

from data validation is best handled in the:

A. Model

B. View

C. Controller

D. State machine

Answer: C

QUESTION 51:

Which TWO of the following are recommended best practices for managing conversational state using HTTP Sessions?

A. Maintain all the session state in a single object and set the object in the HTTP Session.

B. Maintain session state in smaller objects and set each of those objects in the HTTP Session

C. Rely on WebSphere Application Server to remove unused session attributes

D. Explicitly invalidate unused sessions.

Answer: B,C

QUESTION 52:

Which TWO of the following describe the characteristics of a value object?

A. It is another name for an entity bean.

B. It is using to reduce the number of network calls between the Web container and the EJB Container

C. It is used when more than one attribute needs to be set on an entity bean

D. It encapsulates dates of an entity bean that is modified more frequently than is read. Answer: B,C

QUESTION 53:

Users of a web application can retrieve account and profile information from two different web pages, but there are significant network delays when data is retrieved. What is the BEST strategy for improving the performance of this application?

A. Create a Value Object on the server that stores both personal and account information.

B. Use JSPs to streamline data access on the two pages

C. Add more servers to provide load balancing for multiple requests

D. Use a JDBC Type IV driver to retrieve data.

Answer: A

QUESTION 54:

Which of the following HTTP session management guidelines is the BEST approach

to improve performance?

A. Remove all unused objects from the HttpSession when they go out of scope.

B. Maintain all data received from the database in the HTTP Session in order to avoid

retrieving it again.

C. Maintain all of the session state in a single object and set the object in the HTTP Session

D. For each JSP page in the application, use the <%@ page session="true"%>directive. Answer: A

QUESTION 55:

A developer is working with a complex web application. Different teams are responsible for developing the presentation, business logic, and data

access.According to Core J2EE Patterns, a way to separate content generation from content presentataion is for the developer to use:

A. Servlets for business logic, JSPs for presentation, and JavaBean for data access.

B. Servlets for business logic,JSPs for presentation, and EJBs for data access

C. Servlets for business logic, JSPs for presentation, and JDBC for data access.

D. JavaBeans for business logic, JSPs for presentation, and EJBs for data access. Answer: D

QUESTION 56:

Which THREE of the following statements are TRUE with regard to the benefits of portioning a Web application using the Model-View-Controller architecture?

A. Modification and maintenance are easier due to cleaner separation of responsibilities

B. Prototypes can be put into production quickly due to reduced need for regression testing.

C. The structure provides better support for scalability in response to increasing workload

D. Legacy applications can be ported quickly in a platform independent manner with less design work

E. Web page designers can work independently of the Java developers.

Answer: A,B,C

QUESTION 57:

Which TWO of the following are TRUE about the "Source -> Surround with

try/catch Block" feature?

A. It creates a try-catch block surrounding the expression to which the cursor is pointing

B. It ensures that at least one line of code is selected to enable the option

C. It generates a try-catch block that catches https://www.360docs.net/doc/db16795946.html,ng.Exception

D. It detects thrown exceptions in the selected code and will generate the appropriate catches for each one.

Answer: B,C

QUESTION 58:

When a developer selects a class and choose Refactor -> Extract interface, the Extract interface wizard:

A. Create an interface that includes every method in the class.

B. Allows the developer to choose which methods in the class should be added to the interface.

C. Enables the developer to add some additional methods

D. Prompts the developer to add the interface methods manually.

Answer: B

QUESTION 59:

When a developer uses the Search dialog in the "dw" tab, Rational Application Developer will perform the search in which of the following locations?

A. All Rational Application Developer Help Files

B. IBM WebSphere Application Server Version 6.0 Online References

C. All content of IBM developerWorks

D. All of the files on the developer Workspace

Answer: C

QUESTION 60:

A standalone Java program has been written using a simple text editor. If a developer wants to incorporate some of the classes into a new Java application using Rational Application Developer, which of the following actions should the developer perform?

A. Create a new Java project specifying the existing class file directory as the input source container.

B. Use CVS-include in the configuration manager for the Java project to add the class files to the java project

C. Import the class files into the output folder of the Java project

D. Add a Class Folder to the Java project using the Java Build path page. Answer: D

QUESTION 61:

The UML Visual Editor can be used to perform which TWO of the following actions?

A. Add methods and fields to a class.

B. Change a class to an interface

C. Refactor fileds and methods

D. Annotate a class.

Answer: A,C

QUESTION 62:

A Java project is initially developed using the project folder as the source folder.

Later it was decided to separate the source and output folders. In order to

accomplish this, which of the following actions should a developer taken in

Properties -> Java Build Path -> Source?

A. Create an output folder under the project and use the project folder for source

B. Create a source folder under the project and use the project folder for output

C. Remove the project folder as the source folder and create source and output folders

D. Use this project for the source and create another project for the output

Answer: C

QUESTION 63:

A developer wants to mark multiple lines of well-written code so that they can be repeatedly identified. The MOST EFFICIENT way of accomplishing this task is to:

A. Create a Task with a unique name on each line of code that can be reused inside the Java editor

B. Create a Task tag in the Preferences window and use that tag to mark blocks of code inside Java comments.

C. Add the word "library" in a Java comment and do a search for "Library" when looking for code.

D. Copy and paste each occurrence of reusable code into a separate file.

Answer: B

QUESTION 64:

A main ( ) method makes calls to methods in other packages. When the Call

Hirearchy view is inspected for " main ( ), there is no information visible except the name of the initial method. What can be done to correct this?

A. Since the main ( ) method is static, it cannot be used as the starting point of a call

RationalRose【UML建模】教程+使用详解

Rational Rose 简介 Rose模型(包括所有框图、对象和其他模型元素)都保存在一个扩展名为.mdl的文件中。 1. 环境简介 1.1 Rational Rose可视化环境组成 Rose界面的五大部分是浏览器、文档工具、工具栏、框图窗口和日志。见图1-1。 图1-1:Rose界面 ●浏览器:用于在模型中迅速漫游。 ●文档工具:用于查看或更新模型元素的文档。 ●工具栏:用于迅速访问常用命令。 ●框图窗口:用于显示和编辑一个或几个UML框图。 ●日志:用于查看错误信息和报告各个命令的结果。

1.2浏览器和视图 浏览器是层次结构,用于在Rose模型中迅速漫游。在浏览器中显示了模型中增加的一切,如参与者、用例、类、组件等等。Rose浏览器见图1-2。 浏览器中包含四个视图:Use Case视图、Logical视图、Component视图和Deployment 视图。点击每个视图的右键,选择new就可以看到这个视图所包含的一些模型元素。 图1-2:Rose浏览器 1. 3框图窗口 在图1-3所示的框图窗口中,我们可以浏览模型中的一个或几个UML框图。改变框图中的元素时,Rose自动更新浏览器。同样用浏览器改变元素时,Rose自动更新相应框图。这样,Rose就可以保证模型的一致性。 图1-3:框图窗口

2.UML各类框图的建立 2. 1建立用例图use case diagram 从用例图中我们可以看到系统干什么,与谁交互。用例是系统提供的功能,参与者是系统与谁交互,参与者可以是人、系统或其他实体。一个系统可以创建一个或多个用例图。 ●创建用例图(图2-1-1) 在浏览器的Use Case视图中,双击Main,让新的用例图显示在框图窗口中。也可以新建一个包(右击Use Case视图,选择new→package,并命名),然后右击这个新建包的,选择new→use case diagram。 对系统总的用例一般画在Use Case视图中的Main里,如果一个系统可以创建多个用例图,则可以用包的形式来组织。 图2-1-1:创建用例图 ●创建参与者(图2-1-2) (1)在工具栏中选择“Actor”,光标的形状变成加号。 (2)在用例图中要放置参与者符号的地方单击鼠标左键,键入新参与者的名 称,如“客户”。 若要简要的说明参与者,可以执行以下步骤: (1)在用例图或浏览器中双击参与者符号,打开对话框,而且已将原型(stereotype)设置

Rational Rose用例图的建模步骤

用例图建模步骤 窗口说明 1.开始 用例图在用例视图目录下,使用右键菜单“new”——》“use case diagram”。

2.工具栏调整 一般情况下,所有UML模型的工具栏都是可以调整的,可以根据具体需要对工具栏上的按钮进行定制。在工具栏上使用右键菜单,选择“Customize”如图2,选择需要增加或减少的图标,如图3所示。 3.增加参与者 参与者的增加有2种方式, 方式一:使用工具栏上的快捷菜单 如图4,图5所示

方式二:使用左边栏右键菜单“new”——》“Actor”新增参与者功能 如图6所示,需要注意的是:使用此方式增加的参与者将不会自动出现在右边的绘图区中,需要把这个参与者拖到绘图区方可。 关于删除:在右边的绘图区,删除参与者可以使用Del键删除,但删除之后被删除的参与者在左边的目录下仍然是存在的。即在绘图区中不能彻底的删除参与者。在左边的目录区, 4.增加用例 用例增加的方式和方法与参与者增加的方式和方法是相同的。 5.建立参与者之间的关系 参与者之间的关系常见的是泛化关系。 步骤如下: 1)选择泛化关系,如图7所示。 2)如图8所示,画出两个参与者之间的泛化关系。注意:起点是继承类,终点是被继承类。即,画的时候是从儿子开始,到父亲结束。

6.建立用例之间的关系 用例之间的关系主要是3种,分别是包含(include),扩展(extend)和泛化(generalization)。我们只要熟悉一种建立方式,其他2种都可以采用同样的步骤实现。 建立包含关系步骤如下: 1)如图9所示,选择用例关系的图标。 2)如图10所示,从“登陆系统”用例开始,到“密码验证”用例结束画出关联关系,注意箭头的方向。 3)双击这条线或者右键点击这条线然后选择“Open Specification”菜单项(图11所示), 在弹出的窗口(图12)的Stereotype中选择包含(include)关系

RationalRose-详细介绍

使用Rational Rose 进行UML可视化建模 本课程以某所大学的《在线选修课程管理系统》为例来介绍怎样使用Rational Rose 进行UML可视化建模。 最终递交三个文件:regist.mdl, regist.sql, VB的代码或Java的代码。 内容: 一、系统描述 (2) 二、用例图(Use Case View) (2) 三、活动图(Activity Diagram)(建立选修课程目录表) (5) 四、相关的包和类以及简单类图 (11) 五、用例实现图(Use Case Realization Diagram) (13) 六、顺序图(Sequence Diagram)与合作图(Collaboration Diagram) (15) 七、类图中的关系(Relationships) (18) 八、类图中的操作与属性 (20) 九、类图中的泛化 (22) 十、状态图(Statechart Diagram) (26) 十一、构件图(Component Diagram) (31) 十二、部署图(Deployment Diagram) (34) 十三、生成程序代码 (35) 十四、创建数据库设计 (40) 十五、附件1:转换后的Visual Basic程序 (44) 十六、附件2:转换后的Java程序 (45) 十七、附件3:生成的SQL语句 (46)

一、系统描述 1.大学教师选择本学期要教授的课程,每位教师最多只能上报4门课程。 2.教师选课结束后,教务管理人员进行协调和确认教师的课程,并创建本学期的课程目录表,向学生公布。 2.学生填写课程选修表,每个学生最多选修4门课程;每门选修课程的学生数最多为10人,最少为3人。人数达到10人时,停止学生登记注册此门课程;3.学生选课结束后,系统自动取消人数少于三人的课程。 4.学生按最终的课程表到财务处办理收费手续(billing system)。 5.教师可查询所教课程的学生花名册(roster)。 6.教务管理人员维护学生、教师和课程的信息。 二、用例图(Use Case View) 1.《在线选修课程管理系统》中的执行者(Actors) ●注册选修课程的学生; ●教授选修课程的教师; ●教务管理人员必须汇总选修课程情况,制作课程表; ●教务管理人员必须维护关于课程、教师和学生的所有信息; ●财务管理系统从本系统中取出收费信息。 2.使用Rational Rose 创建执行者(Actors) 图1

Rational Rose顺序图(序列图)的建模步骤

序列图的建模步骤 1.创建和删除序列图 1.1 创建序列图 新建一个序列图的方式有两种: 1.1.1 在逻辑视图中增加序列图 1)一般情况下,序列图属于系统的逻辑模型,因此可以使用“Logical View”的右键菜单——〉“New”——〉“Sequence Diagram”,如下图所示: 然后输入序列图的名称,如下图所示: 接着双击新增的序列图名称,开始输入序列图,如下图所示:

1.1.2 在用例视图中增加序列图 序列图主要是用于对用例的描述,在此种目的下新增序列图的方式也是有两种: 2.1)直接在“Use Case View”下的相应用例上通过右键菜单——〉“New”——〉“Sequence Diagram”菜单项新建一个序列图,如下图所示: 输入序列图的名称,如下图所示:

输入完序列图的名称后,双击此序列图的名称开始输入序列图的内容。 2.2)在用例图中使用用例的属性窗口来新增序列图。如下图所示,在用例“浏览课件”的“Specification”属性窗口中的“Diagrams”项目下,通过右键菜单——〉“Insert Sequence Diagram”, 输入序列图的名称,如下图所示: 双击此序列图名称,进入序列图的编辑界面。

1.2 删除序列图 不管是在逻辑视图(Logical View)还是在用例视图(Use Case View),删除序列图的方式都是一样的。都是选中需要删除的序列图,右键菜单——〉“Delete”,即可直接删除,如下图所示。注意,在Rational Rose2003环境下,所有的删除操作都是没有提示的。 1.3 修改序列图的名称 不管是在逻辑视图(Logical View)还是在用例视图(Use Case View),修改序列图名称的方式都是一样的。都是选中需要修改名称的序列图,右键菜单——〉“Rename”,如下图所示: 2.增加和删除对象 2.1 增加对象 在序列图中,增加对象的方式主要有两种:

RationalRose详细介绍和例子详细操作

使用R a t i o n a l R o s e进行U M L可视化建模本课程以某所大学的《在线选修课程管理系统》为例来介绍怎样使用RationalRose进行UML可视化建模。 最终递交三个文件:regist.mdl,regist.sql,VB的代码或Java的代码。 内容: 二、用例图(UseCaseView)............................................... 三、活动图(ActivityDiagram)(建立选修课程目录表)....................... 四、相关的包和类以及简单类图.......................................... 五、用例实现图(UseCaseRealizationDiagram)............................. 六、顺序图(SequenceDiagram)与合作图(CollaborationDiagram)............. 七、类图中的关系(Relationships)....................................... 八、类图中的操作与属性................................................ 九、类图中的泛化...................................................... 十、状态图(StatechartDiagram)......................................... 十一、构件图(ComponentDiagram).......................................

Rational_Rose_教程+使用详解

UML 面向对象分析与设计教程 上海钱拓金融信息服务有限公司 内部文档禁止外传

目录 一.Rational Rose 简介 (3) 1.1 环境简介 (3) 1.1.1 Rational Rose可视化环境组成 (3) 1.1.2浏览器和视图 (4) 1.1.3框图窗口 (5) 二.UML各类框图的建立 (6) 2.1建立用例图use case diagram (6) 2.2建立活动图activity diagram (11) 2.3建立类图class diagram (15) 2.4建立交互图interaction diagram (20) 2.4.1序列图sequence diagram (20) 2.4.2协作图collaboration diagram (23) 2.4.3序列图和协作图之间的转换 (26) 2.5建立状态图statechart diagram (26) 2.6建立构件图component diagram (30) 2.7建立实施图deployment diagram (32)

一.Rational Rose 简介 Rose模型(包括所有框图、对象和其他模型元素)都保存在一个扩展名为.mdl的文件中。 Rational Rose中用例视图和逻辑视图的区别用例视图是从系统外部来看系统,逻辑视图是描述系统的内部结构。 两者之间的关系是实现关系,即,逻辑视图所描述的系统实现用例视图所描述的功能。 举个最简单的例子吧:对于很多系统都有的用户登录功能 在用例视图中只描述用户在什么样的界面登录(是登录对话框,还是指纹鉴别器,还是身份识别卡,也许都可以),如何登录(是输入口令,还是将手指放在指纹阅读器上,还是将身份识别卡在读卡器上划过),系统有什么响应(登录成功后是显示正确提示,还是有悦耳的声音,还是吐出两张美金,登录失败后是回到登录界面,还是放个P,也许是从机器里冒出一只拳头打在用户的脸上)。但不会描述系统内部如何去验证用户,以及如何出拳。 而在逻辑视图中则是描述系统如何验证用户,可能有一个登录界面类,有一个用户认证控制类,及用户信息存储类,以及这些类如何相互运作以完成用户认证,也许还会有拳头控制类来实现拳头瞄准和出拳,总之要将用例视图中提到的功能全部正确的实现。 1.1 环境简介 1.1.1 Rational Rose可视化环境组成 Rose界面的五大部分是浏览器、文档工具、工具栏、框图窗口和日志。见图1-1。

Rational-Rose-―正向工程操作步骤

Rational Rose —正向工程操作步骤 利用Rational Rose构建正向工程的步骤: 步骤一,通过Rose建立一个新的Logial View。这里我另外给大家展示一张类的属性以及一些特定方法的自动生成,如图所示: 步骤二:构建类关系图,添加:包,类关系,结构以及注释等等,关于UML类逻辑图如何构建,我这里就不多赘述了。 步骤三:点击上端菜单栏中的Tools下拉菜单—Java / J2EE—Project Specification; 在弹出的对话框的Code Generation标签内编辑生成代码的属性,比如:“Generate Rose ID”,“Generate Default Return Line”,并选中“Automatic Synchronization M”。如图所示:

步骤四:继续在当前对话框内,点击标签:“Classpath”,在对话框内,点击新建ClassPath 按钮,注意:这里的Classpath并非java在环境变量中定义的:classpath;而是定义:需要将生成的java代码保存到的路径。 步骤五:完成步骤三,与步骤四后,点击“应用”—“确定”按钮。 步骤六:完成前面几个步骤的生成配置后,我们将在步骤六介绍生成java文件啦。 A,键盘Ctrl+A选中类图中,刚刚构建的所有元素; B,点击上端菜单栏中的Tools下拉菜单Java/J2EE—SynTax Check(语法检测);正常的,Rose应弹出:Syntax checking completed successfully. C,点击上端菜单栏中的Tools下拉菜单— Java / J2EE—Generate Code来生成java代码。在弹出的Assign CLASSPATH Entries对话框中:在左侧选择文件保存目录,右侧选择需要保存的包和元素。如图所示:

Rational Rose使用简单教程

Rational Rose使用简单教程 概述: (1) 使用Rational Rose 提供的模型去画UML图 (2) 用例图 (2) 类图 (6) 对象图 (7) 状态图 (8) 顺序图 (9) 协作图 (10) 组件图 (11) 部署图 (11) 活动图 (12) 概述: UML能从不同的角度去描述系统,它提供了九种图,下面我们用一张图去对比这九种图的用途 使用Rational Rose创建用例

创建方法: 1.右击browser框中的Use Case View包,弹出快捷菜单; 2.选择New——Use Case项; 3.输入用例的名字;(如出错,可用Rename命令更改) 4.如果文档窗口不可见,选择屏幕上方的View—— Documentation菜单; 5.在browser框中选中所需用例; 6.将光标置于文档框中,输入相应文档。 其他几种图的创建方式类似,只需记住创建图的名字即可。 1、用例图:Use Case Diagram 2、类图:Class Diagram 3、对象图:Object Diagram 4、状态图:State Diagram 5、顺序图:Sequence Diagram 6、协作图:Collaboration Diagram 7、组件图:Component Diagram 8、部署图:Deployment Diagram 9、活动图:Activity Diagram 使用Rational Rose 提供的模型去画UML图用例图 双击browser框中的Use Case View包中的Main条目,打开主用例图; 单击选中browser框中的执行者,并将其拖到主用例图中;

实验用RationalRose生成代码

实验:用Rational Rose生成代码 在Rational中提供了将模型元素转换成目标代码,以及将目标代码转换成模型元素的功能,我们称之为"双向工程"。这极大地方便了软件开发人员的设计工作,能够使设计者把握系统的静态结构,起到帮助编写优质代码的作用。 不同的版本对于代码生成提供了不同程度的支持,在Rational Rose 2003中,Rational Rose Enterprise版本可以使用多种语言进行代码生成,这些语言包括Ada83、Ada95、ANSI C++、CORBA、Java、COM、Visual Basic、Visual C++、Oracle 8和XML_DTD等。我们可以通过选择"Tools"(工具)下的"Options"(选项)选项查看其所支持的语言信息,如图5-23所示。 下面,我们以Java目标语言为例,说明使用Rational Rose生成代码的四个步骤。 步骤1. 选择待转换的模型元素 在Rational Rose中,打开已经设计好的目标模型:类、构件或包。使用Rational Rose 生成代码一次可以生成一个类(Class)、一个构件(Component)或一个包(Package)。我们通常在逻辑视图的类图中选择要转换的类,在逻辑视图或构件视图中选择要转换的包或构件。如果选择的目标模型是包或构件,则在这个包或构件下的所有模型都将被转换成目标代码。 步骤2. 检查模型的正确性和Java语言的语法错误 Rational Rose拥有独立于各种语言之外的模型检查功能,通过该功能,能够在代码生成以前,保证模型的一致性。在生成代码前,最好检查一下模型,发现并处理模型中的错误和不一致性,使代码正确生成。通过选择"Tools"(工具)下的"Check Model"(检查模型)选项,可以检查模型的正确性,如图5-24所示。

相关主题
相关文档
最新文档