Software Model Foundation - Interface (Interface)

zhaozj2021-02-16  89

1.1. 2 interface (Interface)

The interface is a service () operation describing the class or component.

How to understand the description, it is better than our house, we put the door, the window is perfect, unfortunately, we have ended the era of oil lamps, we need to pull wire, how to pull, there is no way, just pull it? It's too ugly!

What is the interface is a wall sleeve for us.

Let's talk about the example.

We gave the wire to leave a wall sleeve, but we used the phone, the network, the power and weak electricity could not share the same set of wall sleeve? How to do? We must also give the telephone line, the network line leaves the wall sleeve, this change is whether the designer can expect in the original?

Even, the walker of the network line is used, then the coaxial cable is used in the first two years. Now it is a super five twisted pair, but also replace it?

Is this too difficult to stay? Yes it is.

How to solve, reconstruct (currently more ways to use more companies)!

1 name of the interface

The graphical representation of the interface: First, a rectangle indicating that the keyword "interface" is indicated, and the operation supported by the interface is in the operation column (like a class diagram). Licen:

The right side of the interface is a component diagram, and we are not described in the current documentation.

The second category is below the small circle, the name of the interface is located below the small circle. The circle symbol is connected to the class or other element of the support interface with a solid line, which can also connect to the high-level container, such as a package.

The circle representation does not represent the operation supported by the interface, which is operated by the rectangle list of the interface. The virtual arrow indicates the operation declared in the class, but the customer class does not require all the operations of the interface. Its virtual arrow connects the interface and the class using it, and the arrow points to the circle.

Description: The above figure shows that the provider of the right interface is used by the client of the left interface.

Similarly, the name of the interface also has a simple name and path name.

2 role of interface

The interface is used to illustrate a collection of services of a service of classes or components, and define the implementation of the service. The interface is used for a set of operands and indicates its characteristic markers and utilities (I explain this word, which is the impact of the problem), not the structure. The interface is not implemented for the operation of the class or component. The operation list of the interface can include a signal of the pre-processing of the classes and components. The interface is a set of partial lines that together implement system or part of the system. The interface is involved in the association, but cannot be used as the associated starting point. (The interface will be described in the association) The interface can be used, and the sub-interface inherits all the operations of the ancestors and can have new operations, and the implementation is considered to be inherited. (Will be described in generalization)

3 understanding of the interface

The interface is an internal and external communication of a thing (this thing is a class or component), from the implementation of the input and output of the data to the input and output of the data, the interface is in the middle of its "level". One will be sent from one end to the other end; one is the legality of the data, and supervise what data and how to take data.

In the example of building a house above, we have all the lines in the room, there are two possibilities, if there is a telephone line in the outdoor, there is a broadband access line, we choose: First, choose the telephone line, use MODEM dialing The way online, low cost, narrow; second, all of the telephone lines and broadband lines.

In this way, in the first way, we only need to provide an access interface of a telephone line, and the second we need to provide two interfaces, which use the access mode different, the category of the line.

Ok, the definition of the interface is obvious. The two ends of the interface (class or component) service is required to call the telephone line and the network cable (internal needs to call and internet), the interface illustrates the collection of the service; the interface definition is The access from the line (telephone line and the network cable) is the implementation of the line. However, the interface cannot be called or internet, it only provides an online export? Quot; level, the level definition The type and principles of the data exchange between the two-end. What is the customer of the interface, the situation is that, if the telephone line suddenly disconnects, the call is repaired, and the Telecom Bureau has been repaired. (Of course, there is a problem with the broadband, telecommunications is available People, I use telecommunications), well, the test instrument brought by the tester can test whether the line is smooth, then we give the testing the function of the test instrument is the client. Of course, the customer One component can also be used.

1.1. 3 Collaboration

Collaboration describes a set of objects in a certain context and interactions between these objects that implement certain behaviors.

Collaboration has a slot that is subject to object and connection (I don't know if the reader will associate with a mail slot and the noun on the operating system, it is interested!), The collaborative channel is also called role, role description The purpose of the object or connection in collaboration.

In Chinese, the word collaboration is helping each other, do something together, but the word is translated. Although it is not the same, it is different, and it means that Collaboration is also the meaning.

Collaboration is a class of categories produced during the action. If we don't do anything, how we talk about its collaboration, and there is a possibility of collaboration on the basis of work. So this section is detailed in the section.

1.1. 4 use case (User case)

This is a paragraph that let me panic, because there is no system is isolated, any meaningful system is preparing for our dear customers. In fact, I am expanded this customer. I am "exaggerated", what is the customer? If we do a self-use test system, who is the customer? It is us, it is of course.

When designing a system or using a system, some people will participate, participate in all things, then these people (actors) and things are use cases. User Case is often translated into "nothing", what is the situation? Happening? situation? I personally think that I personally think should be "case", I think it should be "use case".

If we have a set of software for the farm, we should understand what the farmer needs do we understand? There are very few farms, it may need a hand-held calculator to completely solve the problem, of course, if the software is needed, we can prepare it; however, if there are many sheep, he has several Ranch, each pasture has different advanced management equipment, then this farmer may need an information acquisition device for a device operation, we can customize a set of information for information collection, concentration, display, and analysis; if There is a batch of agricultural scholars, which may require weather data, ranch grass, and the size of the flocks, and analyze the growth of the flock, and disease resistance ... etc. The situation, let's analyze the "example", you need to consider different data, and analyze the architecture of the software for this class.

Create an example of an example (Figure), we need to know how its main factor is how we can do not detail the user's use case! It is the case where the system creation is "probably", "suggest", describes the "example" (at this point, refers to the actual situation described). 1 Name of the use case

Use case is a description of a set of action sequences (including its variable--- derivative), the system performs the action sequence (with the understanding of the sequence, see Chapter 1) to generate a observable for participants. Result value.

Therefore, the name of the use case is the sequence name of the action, with its class name, there is also a simple name and path name. The front of the path name is the package name. Such as: PackageName :: UsecaseName

There are two types of use, one is the elliptical inside marketer, which may be a simple name or a path name.

Use examples and classes, the interface is the same as operation and attributes, and if you need to represent the operation or attribute of the exemption, we can represented by a rectangular box (class) with "use case".

2 use case representation and association

One. Use case and participant's association

The association between the participant (that is, human) and the use case is used as the association between the participant (that is, the communication) between the participant (the participant) and the exemption. The communication is required, indicating that participants have those requirements for the system, ie, the system can provide those services to participants. The implementation of this service is the implementation of the use case.

If the picture is the number of Error.cao, the number of Error.cao, it can also be seen since then, and Mr. Error.cao is a farmer, he cares about the number of year-end sheep, but at this time, he only It can predict the number of old-termized sheep, and he uses ForecaseAccount operation method.

In this way, we can understand the relationship between use cases and participants. Under normal circumstances, my personal understanding is: participants are the use case.

two. Use an example and state machine, the relationship between the activity map

We have not recognized state machines and event maps, so wait again.

three. Use an example expansion point representation

The extension is a nomenchat entity in an example. The location of the use case action sequence from other use cases can be inserted. Extended points reference one or set of positions in order, provide an indirect level between the extension and behavioral sequence text. The extended relationship between the extension point can be independently changed, and the relationship between the AccountSheep case and the DateTimePhase example shown in the figure is an extended relationship, which does not affect the representation (documentation and implementation) .

The right picture is the relationship diagram of the use case, indicating an extension point in the description of the use case of AccountSheep, which uses "extend" to represent the relationship, and the extension can be listed in the use case area, the title is extension point Such as DateTimePAHSE use case.

The generalization relationship is indicated by an arrow, from the child to a solid line of the parent example, a solid triangle arrow (the figure is drawn by ROSE, it looks like a hollow) point to the father's use.

Just simply say generalization, first meet the word "assimilation", which is intended to make it the same, at least category, in the chart theory being assigned. Ok, then? Let it topologize!

It is very simple to analyze, the differences between the various terms, and now you should know why I will explain the importance of the analysis of mathematics. Don't worry, there are more advantages to see it! The use case is generally used as one or more sub-cases, which represent more clear forms of parent examples, but it should be noted that these clear forms are directionality relative to the parent example, that is, the child use case is only in the form of a father. Some partial operations or properties are generally used: different characterization of the same parent example is independent (of course, this independent is directional).

Of course, the child use inherits all the operations and properties of the father's case.

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

New Post(0)