Develop J2EE Application with Rational Rose and UML (1)

xiaoxiao2021-03-06  107

Foreword successfully uses the key to build enterprise applications with J2EE and all complex software platforms: effective demand communication, formulate correct analysis and design decisions, and identify the best implementation.

Companies pursue the best visual model can develop their software more quickly and build higher quality systems. Unified Modeling Language (UML) is a visual model-modeling software industry standard.

Here, we will introduce you how to use UML and Rational Rose 2001a, which is the most popular UML-based software modeling and development tools today, which can be used to develop J2EE-based enterprise applications.

What is UML? Unified Modeling Language (UML), is started with an OMG standard in 1997. It is a graphical language that supports modeling and software system development, providing modelization and visual support for all phases developed, including Demand is analyzed to specifications, to construct and configuration.

Using the UML is mainly to understand the important details of the system so that the demand for the project can be clearly expressed, the solution system is developed, and one selected implementation can be clearly identified and constructed. In order to achieve this, we need a rich symbol to express modelized software systems. UML not only provides symbols for basic structural blocks, but also provides a method of expressing complex relationships between basic structural blocks. These relationships are expressed in the form of a UML block diagram.

Let's take a look at how UML and Rational Rose help understand, design, and implement J2EE applications.

The reason for understanding the failure of demand projects is usually due to the need to understand or communicate well. We can also understand it, whether it is verbal or written language, it is not strict.

You can apply a UML model model to develop a precise model to represent the needs of the system, and then drive other aspects of system development in this use case. The role of the use case is like a line on the necklace, which is bound to all the pearls. The use case establishes a bridge between the final user and system requirements. They can be used to backtrack between functional requirements and system implementations themselves. The use case can also be used as a connection point to connect to a detailed description of the use of an example document.

Figure 1 shows a partial case block diagram of an online CD store, which is extracted from text and oral functional requirements, and then turn to the use case. In this example, it is obvious that the purchaser (a character consisting of several lines) can be used in four ways (in UML to represent an ellipse in the UML).

*********** Figure 1 * ******* A simple case example

Each use case is accurately described by one or more scenes in the sequence block diagram. Of course, in the early stage of demand capture and analysis, the sequence diagram is relatively simple, and it may be incomplete. Such an example of the sequence diagram is shown in Figure 2. In Rational Rose, create a sequence diagram for an use case, you can select it in your browser, then select New> Sequence Diagram from the menu of the usage case.

********** Figure 2 *********** A sequence diagram of the cost example

Designing a program subsequent stage is the use case analysis, how to interact to meet the functional requirements of the system, and how they are related, this phase provides an initial, high-level definition. This analysis requires repeated test until a satisfactory solution is produced. "Analysis classes" behavior is usually described by natural language, comparative abstraction, in which it is a useful tool. Analysis class is usually not implemented in software, although we can do this, in fact, analytical classes are converted to precisely defined design classes and subsystems during the overall design process.

We must first create sequential diagrams so that they can reveal the internal operation of the system, and we are not analyzing the system by displaying roles and a system interaction, but the system is decomposed into independent analytical objects. The responsibility of the system is broken down into the object of the analysis level, so as to get a better sequence diagram. Here we want to introduce three analytical objects:. The boundary object boundary object represents the internal work of the system and interaction between the environment. It includes a user interaction with a graphical interface, interacting with other roles (such as role representing other systems), and the interaction of the device. The boundary object isolates and protects the other parts of the system and the outside. Simply put, each role-use case interaction map to a boundary object.

Important information of entity object entity represents the system. They are all lasting and existing in a long time. Their main purpose is to express and manage information in the system. In the model, the key concept in the system is expressed in an entity object.

The control object control object is used to model behavior in the system. Control objects do not need to implement this behavior, which may be collaborated with other objects to implement the use case. Its idea is to isolate the information of the behavior and the next layer of the model, so it is easier to change after the change in the process.

UML provides a STEREOTYPE symbol, which is represented in a text in a double-stroke, so that different types of classes are distinguished. In Rational Rose, you can easily create an analysis class, just modify the class's STEREOTYPE fields to <

>, <

> And <

> Yes. These can be used as the basis for creating an analysis stage block diagram.

A update version of the payment case sequence diagram is shown in Figure 3, where the system is decomposed into an analytical object. In this figure, use the icon to represent boundaries, control and entity objects (represent a T, circle with arrows, and circle with a tangential circle, respectively).

Of course, the class is usually involved in several use cases, so it is equally important to understand that their static relationship is also equally important to ensure the consistency of the system. The UML class diagram is useful for capturing a static model of different structural elements.

First, we identify and place all classes in the use case into a class block diagram. We have distributed the behavior of the usage to the object, so analyze the operation of each class becomes relatively simple. It should be noted that these are analytical operations, which means that as we have continuously analyzed and designed, these operations will continue to refine.

Rational Rose allows you to define new operations very simply on the analysis class in the sequence chart. You just choose existing information and select on the menu.

It is possible (as shown in Figure 3). If you have defined a class's action, you can simply select an existing operation on the list.

**** Figure 3: Exact sequence of analytical objects ****

This is a typical method in Rational Rose, which enhances the user's productivity and ensures consistency and quality of the entire model. Another similar useful feature includes which classes and messages with query models are not explained (eg, in the model There is no map to a real class or action).

Another aspect is to identify the properties of each class. The information representative of the attribute may be otherwise required, or the class itself is required to fulfill its responsibilities. In this analysis phase, the attribute identifies to ordinary types, such as numbers, strings, and the like.

To complete the class diagram of the use case, you also need to identify the relationship between the class. In this stage, we are particularly interested in relationships to be associated, dependent, and inheritance.

After analyzing all the use cases and creates a block diagram for each use case, we need to join a variety of different analytical classes to get a unified analysis model. This is an important activity because we need to get a minimum set class, and unnecessary redundancy in the final analysis model.

The main task of this phase is to identify classes that are repeated during use or only small changes. For example, we should merge them with similar behaviors or control classes that have the same concept between the jgly. Entity classes with the same attribute should also be merged, and their behavior is also merged into a class. Figure 4 shows a class block diagram (which is obtained according to the use of Figure 1). Since we are now just relationships, we use Rational Rose's display filtering capabilities to filter out the details of each class (via non-ticking format> show all attributes and format> show all operations).

********** Figure 4 ******************************

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

New Post(0)