[Repost] Rational Rose2002 Learn Notes

zhaozj2021-02-12  153

Rational Rose2002 Learning Notes

1. Role of Rose

(1) Project start phase

Production case model

(2) Refining phase

The class box diagram of the development program, the cooperation map, first is the object to be developed, and its interaction between each other. Class block diagram display the inter-object interval.

(3) Construction initial stage

Generate a component block diagram, display the correlation between system components, and generate the frame code of the system.

(4) Texture phase

The new development code is transferred to the model by reverse engineering to the model, thereby reflecting the changes in the development phase to the model.

(5) Interchange

This stage, Rose is mainly used to update the model when the software product is completed.

2. How to choose the default programming language

For example, the method of selecting a VC language is, Tools-> options-> notation-> default-> VC .

3. Use of use case view

The USE Case view includes all roles in the system, using cases and USE case block diagrams, may also include some sequence and collaboration block diagrams.

At the beginning of the project, the main user of the USE CASE view is customer, analyst and project administrator. These people use the case, the USE case block diagram, and the use of documents to determine the high-level view of the system.

Using cases only focus on the role of the system, not to pay attention to its implementation details.

4.Logic view uses two steps

The Logic view uses two steps, first marked the analysis class and then marked the design class. The so-called analysis is not related to the language. For example, there is a Boundary class, a Control class, an Entity class, etc. Design classes have specific language characteristics, such as Java classes, or C classes. There is no correspondence between the analysis class and the design class.

5. What is the role of Logic view?

The Logic view is concerned that the system's logical structure. In this view, you want to mark the system components, check the information and functionality of the system, check the relationship between the formation. Reuse here is a major purpose. Determining the repetition class and packages by carefully assigning the information and behavior of the class, the combination class, and the relationship between the classes and bags. Once you have completed multiple projects, you can add new categories and packages to your reputation library. Future projects can assemble existing classes and packages without having to start from scratch.

6. Use the control unit to support multi-user parallel development

Rose supports multi-user parallel development through the control unit. The control unit in ROSE enables any packages in the USE CAS view, Logical view, or Compinent view. In addition, the Deployment view and the Model Properties unit can also control. When a unit is controlled, it is stored in a file independent of the model other departments. In this way, stand-alone files can be used to control the SCC's version control, such as the basic tools of Rational ClearCase, Microsoft SourceSafe, and Rose. The control unit can be loaded or unloaded from the browsing model. You can also check the import and exit (Checked IN and OUT) using the control tool.

7. Input Output Model

A major advantage for object-oriented mechanisms is repeated use, reused not only for code, but also for model. It is necessary to make full use of repeated use. Rose supports output and input models and model elements. The model or partial model can be output. Enter another model.

Note: When you want to output a package or class, you must select the things in the logical view; to output the model, it is something other than this.

8.USE Case and Role

Use cases and roles to describe the range of the system built, using cases include everything in the system, and the roles include everything outside the system. No program details are considered. Using a case is the advanced function block provided by the system, the role is an object interacting with the system. 9. ISE CASE VIEW How to arrange more reasonable

The main view in Use Case View is primarily used to display the case package. As for the use case in the package, you can place it in an additional view, this view is named by the name of the package, which can be separated from the main view to make the entire USE CASE view clearer.

10. Some requirements about USE Case View

(1). Do not moderate communication between the characters, because the role is outside the system;

(2). Box diagram Displays the available cases, but no matter the order of execution, do not draw arrows between the case, unless expressed the use of relationships and extensions;

(3). Each case is started by the role, which means there is an arrow between them, except for the use of relationships and extensions;

(4). You can regard the database as the layer below the entire USE CASE box. You can use a case to enter information in the database, and then access the information in the database in another case, do not draw arrows between using the case Show information flow (with 2: Do not draw arrows between using cases unless expressed the use of relationships and extensions).

11. Different cases of cases and traditional methods

Decomposing the project into a case is an object-oriented process rather than achieving the process, there is a different functional decomposition method. Functional Decomposition Pay attention to how to break down into a system-processed small block, and use case first pay attention to the user's needs.

12. How to find cases

Check the documentation provided by the customer, and ask what features that the end customer needs:

(1) What is this system to do?

(2) Do users want to maintain any information (generated, read, update, delete)?

(3) Do users tell the system to the system?

(4) Do you want some changes and events to tell users?

13. Some suggestions on the use of cases

(1) Use the case independently of programming details, it is concerned that the system's function is instead of this feature.

(2) Use the case is a high-grade view, not too much, the number of usage cases of general users is 20 to 50. It can be used to use the relationship and extended relationship to use the case to make the necessary decomposition, or the case combination is used as groups to facilitate organization.

(3) Use the case to follow the user using the system. Each case should represent a complete transaction between users and systems to provide users with a certain value. Use the case should be named after the business is named instead of the computer technology term, it should make the customer at a glance. Using cases usually use verbs or verb phrases to describe the final result of the customer, the customer does not care about what to do with these needs.

14. How to check if the case is complete

(1) Is each functional requirement in a case in one case? If required not in use, it will not be implemented.

(2) Do you consider how each user uses the system?

(3) What information is provided to the system each user?

(4) What information has each user receive from the system?

(5) Do you consider the maintenance problem? Someone will start and turn off the system. (6) Does all external systems that the system want to interact?

(7) What information is received from the system from the system, what information is sent to the system?

15. Use the details of the case - Building a stream

(1) Brief Description: Describe the role of the case;

(2) Prerequisites: Conditions that must be met when starting using cases;

(3) Main event streams and other event streams: The specific details of the case are described in the main event stream and other event streams. The event stream is to pay attention to the system, not how to do it.

a. How to use the case;

b. Use various paths of the case;

C. Use the normal (main) process of the case;

d. Use the modifications of the main event stream of the case (other event flow);

e. Error event stream;

f. How to use the case end.

(4) Post-event conditions: It must be true after the case is completed.

16. Name name

Each case in the model should have a unique name. Using a case should be named from a customer perspective to help determine the project range. The case name is used should also be independent of the implementation method. To avoid phrases that use cases to contact specific implementations, such as Internet. Use cases to name the verbs and phrases.

17. Classification of roles

There are three major categories: system users, other systems interact with the system, time.

Time is used as a role that a certain event is triggered. For example, the ATM machine may run some coordinated processing every night. Since the event is not within our control, it is a role.

18. Role version

Despite a variety of options, only one actor can be selected.

19. Role base

How much examples need to develop a role.

20. Use cases and roles to support four relationships

Communicates Relationship, use relationship (Extends Relationship), Actor generalization.

Communication: the relationship between roles and use cases;

Using: Make a case to use another function to use the function provided by using the case, usually use the relationship to construct some two or more case-use commonly reusable functions. As shown in the figure below, the authentication process can be shared.

Extension: Make a case to expand another function of using a case. It is similar to the use of relationships, all of which is separated from the common function to another in the case, but the direction of the arrow in the legend is just the opposite.

The role is generalized: indicating that several characters have some commonality. For example, company customers and individual customers are customers, their relationships are shown in the following figure, the decomposition hierarchical level of the left and right figures

This relationship is not always necessary. In general, only when the system is considered to be characterized by another role. If the company's customers launched some personal customers who don't start, it is best to perform roles. If the two customers use the same case, there is no need to perform roles. If the two customers use the same case case, it is only a slightly different, and there is still no need to perform roles. The fine difference can be represented in the event stream document of the case.

twenty one. About the use of cases, roles

This chapter ends how to use cases, roles, and USE case block diagrams. The requirements of the system are set up in all cases and roles. First, be a master USE case block diagram, the overall view of the system is displayed. Other block diagrams can then be generated. Demonstrate use cases and roles interaction. Use the case to use and expand other cases. Also directly communicate with the cases. One case always needs another case when using the case's function. One case option is available to extend the use of the case when using the case. If a case is used or expanded another case, the user is a phenomenon using a case. The case where the use of the role involved is specific to the specific use case. Roles can be communicated with cases to demonstrate which role is involved in which case. The roles can also be inherited with each other. For example, students may be roles in the system, and we must further divide students into full-time and half-day students. At this time, full-time and half-day students inherit the student role.

twenty two. Continuous classification of objects

(1) Continuous persistent: Save to the database or other continuous memory, such as hard disk, disc or floppy disk.

(2) Static STATIC: Static object is saved in memory until the program terminates, and does not save in the external continuous memory, the global objects in C .

(3) Temporary Transient: Temporary object is only saved in memory in a short time.

Note: If the sustainability of the object's class is set to Persistent, the persistence of the object can be set to Persistent, Static or Transient. If the continuousness of the object's class is set to Transient, the persistence of the object can only be set to static or transient.

twenty three. Sequence diagram and different points of collaboration map

(1) Only the sequence map has control focus FOCUS OF Control

(2) Only the cooperative diagram has a data stream: The data stream is a value returned after a message is sent to another object.

(3) Collaboration diagram shows information flow, but does not display time. Collaborative diagrams show messages between the relationships between the objects and between objects. From the designer, which object can be seen is a bottleneck, or find those objects need to communicate directly.

twenty four. Synchronization of messages

(1) Simple Simple: The message runs in a single control thread.

(2) Synchronous SYNCHRONOUS: After the customer issues a message, wait for the supplier to respond to this message.

(3) Block BALKING: The customer issues a message to the supplier, if the supplier cannot receive a message immediately, the customer gives up this message.

(4) Timeout Timeout: The customer issues a message to the supplier, if the supplier cannot receive a message at the specified time.

(5) Asynchronous asynchronous: Whether the message is received or not, there is no other thing regardless of the message.

25. Message frequency

The frequency of the message allows the message to be transmitted at a specified time interval, for example, once every 30 seconds.

(1) Regular (Periodic): Regular message;

(2) None regular (aperiodic): Uncertain messages, only one time, or send it in irregular time.

26. Two-step legal transaction mutual map

Step 1: Focus on the advanced information care about customers. At this time, the object has not mapped the class, and the message has not been mapped. These pictures are just let analysts, customers, and other people interested in business processes to understand the logical flow of the system.

Step 2: After the client is unified, the team adds more details. The block diagram is more useful to developers, testers, and other members of the project, and the role of customers is not big. First, add the object. It may be added to the control object, the database connection object, the security handler object, the error handling object, and the like.

Usually each interaction map has a control object, responsible for the program in the scenario. All interactions of a case may share a control object, so a control object can handle all program information of the case.

Note that the control object does not perform any business processing, just send messages to other objects. Control objects are responsible for coordinating the effects of other objects and entrustment responsibilities. Therefore, the control object is sometimes referred to as a manager object.

The benefits of using control objects are capable of separating business logic and program logic.

Next, map each object to a class. You can map to the ready-made class or the newly generated class.

Next, each message mapping in the block diagram will be operated.

Second, the details of the design objects and messages, the continuity of the object, the message synchronization, and the message frequency, and the like.

Finally, a model quality report is generated, showing unmapped objects and messages.

27. How to find classes

(1) You can start from the event stream of using the case to see the nouns in the event stream.

(2) Check the object in the interaction, and find classes through the commonality of the object.

Search for class to consider three different layers: Entity, Boundary, Control.

28. Class species

Ordinary class, parameterized, instantiated class, class utility, parameterized utility, instantiated class utility, molic class.

(1) Parameterization class ParameterizedClass: Used to generate a series of other classes, usually parameterized is a container, also known as template. Set the value of the parameter in Detail-> Formal Arguments.

(2) Instantiated class instantiatedclass: Parameterized by actual variable value.

(3) Class utility CLASSUTILITY: is a set of operations, such as mathematical functions. Class utility often uses the functions provided by the extended programming language or placing a group of generally available function blocks to use many systems.

(4) Parameterized Utility ParameterizedClassutility: Yes Generate Class Utility Template.

(5) Instantiated class utility instantiatedclassutility: is the parameterized utility of the parameter.

(6) Metai Metaclass: An example of a molic class is a class rather than an object. Parameterized and parameterized utilities is a category.

29. Class version

Three: physical classes Entity, border class boundary, control class control.

(1) Boundary Boundary Classes: At the junction of the system and the outside, all forms, reports, interfaces such as hardware such as printers and scanners. Looking for a boundary class to find cases, there is at least one border class between each "Role-Use Case", which may be shared with other "roles - use cases".

(2) Entity Entity Classes: Save information to be placed in continuous storage. Substations are typically in an event stream and interactive diagram, which is the most meaningful class of the user, usually named by business domain. Typically, a table can be generated for each entity class in the database.

(3) Control class Contro classes: Coordinates other classes of work. Each case usually has a control class that controls the order in which the time in the case is used. Note: The Control class does not complete any feature, and other classes do not send a lot of information to the control class, but there are a lot of information that makes a lot of information, and the case is just entrustment to other classes. To this end, the control class is also known as the management class.

There may be many control classes to be shared between many cases. These control classes can analyze the functions used by the system.

30. Set the visibility of the class

The Visibility option determines whether you can access this class outside, there are three options:

(1) PUBLIC: All other classes in the system can access this class.

(2) Protected, private: This class can be accessed in nested classes, friendships, or all kinds in all kinds.

(3) Package or Implementation: This class can only be accessed by other classes in the same package.

31. Class base

You can set the number of instances of the class. There is also a "role" of the base.

32. Class storage requirements

Indicates the relative or absolute memory demand for each class.

Class utilities, parameterized utility, instantiated class utility cannot use this field.

33. Sustainability

Persistent: The information in the class object is stored in the database or other permanent storage.

Class utilities, parameterized utility, instantiated class utility cannot use this field.

34. Setting class concurrency

The concurrent description of the appearance of the performance when there is a plurality of control threads.

Sequential: There is only one control thread, and the class is working properly, and it cannot be guaranteed when there are multiple control threads.

Guarded: When there are multiple control threads, the class is working normally, but the classes in different threads should cooperate with each other to ensure that they do not interfere with each other.

Active: Class has its own control thread

Synchronous: When there are multiple control threads, the normal work does not need to cooperate with other classes because other classes themselves can handle mutually exclusive situations.

34. Use the package in the class block diagram

(1) Bracket by version

Such as physical classes Entity, border class Boundary, control class package control.

(2) Subcontract by function

Such as secure bag security, error handling package error Handling ...

35. How to find attributes

(1) Review the case of use. Look for nouns in the event stream.

(2) Demand document. Demand may introduce the system requirements which information is collected, which is the properties of the class.

(3) Check the database structure. If the database structure has been defined, the fields in the table are attributes. Note that the database table and the entity class are not always one or one.

The properties of the class should not be too much, and if too much can be broken down into smaller classes. The number of attributes of the class is preferably controlled below 10 to 15. The same attribute is not too small, too little can be merged.

36. How to distinguish attributes and classes

(1) Consider whether this information is active, if there is, it should be processed;

(2) According to the specific needs.

36. Set the inclusion of the properties of the class

Property inclusion description properties How to store them in a class.

Press value by value: Property is placed in the class. For example, if the attribute is defined as a string, the string is placed in the definition of the class.

Press to reference by reference: Property is placed outside the class, and the class points to this property.

Unspecified: No to specify the inclusion type. Default setting.

37. Setting the properties of the class to be static such that all this class object is shared.

38. Specifies a gap attribute

It is an attribute generated by other attributes.

39. Type of operation

(1) Implementation Implementor Operations: Realize some business functions. The implementation operator can be found from the interactive block diagram.

Each implementation should be able to retrore the requirements: requirements -> Use the case-> Event stream -> message -> operation.

(2) Manager Operations Manager Operations: Managing objects and constructs. For example, a class constructor and a delete.

(3) Access operation Access Operations: Attributes are usually dedicated or protected, but other classes may have to browse or change the properties of a certain class, which can be implemented by accessing operations.

The industry standard is to establish GET and SET operations for each property.

(4) Help Operation Helper Operations: is the operation you need to complete the task, and other classes don't need to know this. This time the class is dedicated and protected.

Typically, the helper operation can be found from the interaction block diagram, which is displayed as a retro message.

40. Procedure for identifying operation

(1) Check the interaction block diagram. Most messages are implementing operations, while retro messages may be a helpful operation.

(2) Consider the manager operation. It may be necessary to increase the constructor and delete, but this is not required, ROSE can be generated automatically.

(3) Consider access operations. Generate GET and SET operations for attributes that need to be browsed or adapted by other classes, but this can also be automatically generated for ROSE.

41. Parameters for operation

That is, the parameters of the function.

43. Specify an operation protocol

Description Customer can perform operations on objects and the order of operation. Do not affect the code generation.

44. Specified operation limit

Specifies the language specificity of the operation. Do not affect the code generation.

45. Specified operation exception

You can list an exception that the operation may thrown, does not affect the code generation.

46. Specify the length of the operation

Specifies the amount of memory required to operate, does not affect the code generation.

47. Specify operation time

Execute the approximate time required for this operation, does not affect the code generation.

48. Specify operation lexical

The operation of the operation can be made, and the operational logic can be described using a dummy code or description. Do not affect the code generation.

49. Relationship between classes and classes

Four relationships can be established between classes: correlation, dependence, accumulation and generalization.

(1) Related Associations: It is a lexical connection between the class, so that a class knows another class's public attribute and operation. Associated with one-way and bidirectional points. If the two classes are two-way association, ROSE places the attribute into each other. The one-way association is as shown in the figure below, and Person knows the open attributes and operations of HOUSE, and House does not know Person. Person in the interaction map can send a message to the House, and HOUSE cannot send a message to the Person.

The associated direction can be determined by interactive, and if the interactive is always sent to the House, it is a one-way relationship from Person to HOUSE. If there is a relationship from HOUSE to PERSON, a two-way relationship is required.

One-way association helps identify the reuse class. If the relationship between House and Person is two-way, each class needs to know each other, so both cannot be multiplexed. Any class that outputs multiple one-way relationships is difficult to reuse, and only a class that receives a single-way relationship is easy to reuse. As shown below

(2) Dependence Dependencies: Display a class reference to another class, add a #include statement in C , so the change in the header file of the reference class may affect the reference class. Dependent and association, first dependence is always one-way, showing a definition of another class, followed by Rose, does not generate dependencies. As shown below, the Client class depends on the definition of the Supplier class. (3) Cumulative aggregations: It is a strong relationship. The accumulation relationship is the relationship between the overall and individual. Cumulative can be retro. Cumulative relationship generates code.

(4) Generalization generalizations: The inheritance relationship between the display class. In UML, inheritance relationship is called generalization, displaying an arrow pointing to the parent class. Note: The number of layers inherited is not too much.

50. How to find the relationship between classes

(1) First check the interaction, if the class A issues a message to class B, they must have a relationship. The relationship that is usually found in this method is related and dependent.

(2) Check the overall / partial relationship of the class, any class consisting of other classes to participate in the accumulation.

(3) Check the general relationship of the class (ie inheritance relationship) to find classes with different types.

(4) Check other general relationships in the class. Find out a large number of common groups to install a new class.

There is not too much relationship with a class, otherwise it is difficult to reuse. There are not many relationships with a good design.

51. Dependency

If some classes in the package A have a single-directional relationship, the two packs have dependencies. As shown in the figure below, the package A relies on B. The package B is easily multiplexed than A.

To avoid interdependence between two packages, because both are not easy to reuse.

52. Several details of the relationship between classes

(1) Broadenity: Demonstrate a few instances of a class at a certain time and one instance of another class.

(2) Relationship Naming: The relationship can be adjusted by the relationship name and role name, and the direction of the relationship name can be set.

(3) version

(4) Role: The role name can replace the relationship name and describe the relationship in the associated or accumulation relationship.

(5) Output control: In the association relationship, ROSE generates an attribute when generating code. The visibility of the generated attribute is set by Export Control fields, as in other properties, there are four visibility options: public, private, protected, package, or importation. In the two-way relationship, the output control of the two properties can be set, and each end of the relationship is generated. In the one-way relationship, simply set an output control. Output control can be set with Role a General and Role B General and Role B General tags in the Standal Spectation window.

(6) Use a static relationship: We know that the association and accumulation will generate code, and the Static field determines whether the generated attribute is static, static attribute is the properties shared by all instances of the class. If a function is set to static, the resulting association property is static.

(7) Use a friend relationship:

A friend relationship indicates that the Client class can access non-open attributes and operations of the Supplier class. Friends attributes can be set to association, accumulation, dependent, and generalization relationships. The source code for the Supplier class includes logic that makes the Client class have a visibility.

(8) Set an inclusion: Determine the property generated by the accumulation relationship, or press the reference to accommodate. In the accumulation relationship, the overall class should be added to the properties of each component class. These properties are set here or by reference. Press value to accommodate the overall and its components simultaneously.

Generate and deploy the overall and its components at different citation attributes.

(9) Use the restriction: used to reduce the range of associations.

For example, we have the association between Person and COMPANY classes. Suppose there is two related companies to a Person ID value, you can add a restriction Person ID in the Person class. As shown in the left picture below.

(10) Use the link element:

(11) Use restrictions: Restrictions are the conditions that must meet. In ROSE, a limiting condition for a relationship or a single function can be set. The limit is limited to generate a code.

53. Class behavior

If a class has some important dynamic behavior, it is necessary to build a state diagram.

One state can be added to five information: activity, enter, exit, events, and status history.

(1) Activity: The behavior of the object during a particular state. The activity is displayed in the state, indicating: do

(2) Enter: The behavior that occurs when the object enters a certain state. Enter in the state shown, indicating: entry

(3) Exit: Act that occurs when an object exits a certain state. Exit in the state shown, expressed as: exit

(4) Event: The event causes the object from one state to another. The event is displayed on the transition arrow.

54. What is a component

The component is the physical module of the code, which can be a code library or a run file, such as * .h, *. CPP, and * .exe in C are separate components.

Before generating code, map each file map the corresponding component. In C , each class maps two components, one is * .h, the other is .cpp.

Once the component is generated, they are added to the Component block diagram and draw a relationship between them. The only relationship between components is dependent, indicating that a class is compiled before another class.

55. Source code library components Type

(1) Component Component: Indicates a software module with definition interface;

(2) Subprogram specification and body subprogram specification and body;

(3) Main Program Main Program: The main program is a file containing the root;

(4) Package specification and body package specification and body: package is a method of implementation.

56. Run the type of component

(1) Executive file

(2) DLL

(3) Task Specification and Body Task Specification and Body: Indicates a package with independent control threads, usually executing files are represented as a task specification with. EXE extension.

55. Steps to generate

(1) Checking model

Model check is independent of language.

Tools-> Check Model. Common issues are: Messages are not mapped, objects are not mapped.

Report-> Show Access ViOLATIONS, it can find problems that occur when there are two classes in different packages.

(2) Generate components

This step C is not required; (3) Put the class mapping component

Drag the classes in the Logic box diagram to the corresponding components in the Component block diagram;

Identify dependence between components.

(4) Set the code generation attribute

Class, attributes, components, and other model elements can set multiple code generation properties.

Rose provides commonly used default settings Tools-> Optoins.

The change in default setting affects all models that use this setting. If you only want to modify the generated properties of a single model, open the specification window of the model, select the language tab and change the properties here.

Cloning Properties Setting: Change the default settings directly, it is better to change the backup attribute settings. It is highly recommended to maintain the original default settings, only change the cloning property settings.

(5) Select classes, components and packages

When generating a code, you can generate a class, one component, or a package at a time.

(6) Generate code

Rose can only generate a program framework. After generating the frame, developers use its coded class to design the graphical user interface.

56. How to set up VC code generation properties

(1) How to generate get () and set () default

Tools-> Visual C -> Property: The Accessors tab controls whether or not accessor methods are generated for a modeled role or attribute Default is not to generate Get and Set accessors If checked, Get or Set accessors are generated when the class is.. Generated for the first time, But Only et IF The Apply Pattern On Code Generation Switch (on the Visual C Properties' Code Update Tab) is Also Checked.

(2) Tools-> Options-> Visual C

转载请注明原文地址:https://www.9cbs.com/read-6541.html

New Post(0)