Object-oriented analysis and design portion -OOA

A second portion OOA

2.1 Object Analysis (OOA) for the definition?

  OOA-- object-oriented analysis, object-oriented method is to use a systematic analysis of the problem domain (the range of issues involved) and system responsibility (developed system should have functions) to analyze and understand, identify and describe the problem attribute definition object, the operation and the relationship between a subject in need thereof responsibility system.

2.2 Object Analysis (OOA) for benefits?

  • Strengthen the understanding of the problem domain and the system of responsibility;
  • Improved communication between the various types of personnel and related analysis;
  • Changes in demand has a strong adaptability;
  • Support software reuse.

2.3 object-oriented tools (Unified Modeling Language) Unified Modeling Language --UML

  UML is a software-intensive system product (model, source code, test, etc.) visualize detailed description, configuration and documentation language.

(1) UML Features

  • Uniform standards
  • Object-Oriented
  • Visualization, power of representation
  • Independent of the process
  • The concept of clear, concise modeling notation, clear graphical structure, easy to learn and use

(2) UML configuration

  UML Class 3 main elements are the basic building blocks, rules, common mechanism

(3) UML view in

  The UML use case view comprises a view, logical view, implementation view, process view, deployment view, referred to as "4 + 1" view

  • With a view Example: Expression of functional requirements for the system
  • Logical View: conceptual design of a system and the like Subsystem
  • Implementation view: for explaining the structure of the code
  • Process view: the case of concurrent execution and synchronization system for explaining
  • Deployment View: physical structure defines the hardware node

Analysis (OOA) 2.4 an object-oriented model and the Statute

  OOA model is the use of object-oriented system model analysis method established basic model consists of three parts, the demand model and auxiliary model.

  The basic model: The basic model in an intuitive way to express the most important system configuration information

  Demand model: demand model is used to define user requirements

  Auxiliary model: auxiliary model offers several basic models to strengthen the organization or supporting graphics understand

  Model statute: the model described in detail

2.4.1 Basic Model - FIG class

  FIG main components constituting the classes, attributes, operations, general - special structure, integral - partial structure, and the associated message. Model information expressed by these components can be viewed from the following three levels:

  • Object Layer - the system gives all objects of the problem domain and the system of responsibility, which describes the system in which classes of objects should be set up
  • Wherein layer - inner wherein each class is given (and represented by the object), i.e., attributes and operations of each class is given, the internal composition of the object described
  • Relationship between layers - each given class (object and represented) relation to each other, comprising:

(1) inheritance (i.e. generalization) - represents a special structure - by a general

Generalization "a kind of", the relationship between the classes and class inheritance i.e.

(2) Relationship between composition and aggregation - partial structure represented - by an integral

Aggregation relationship "has-a", the combination relationship "contains-a": gather an overall relationship of things - the relationship between partial weaker, relationship between an overall combination of things - a strong part of the relationship situation

Difference: a combination of relations as a whole and some have the same life cycle. In the aggregate relationship, the object represents part of things can belong to multiple aggregated objects, which can be shared by multiple gather objects, and can be changed at any time aggregate object it belongs. Object represents part of things and gather representatives of the lifetime of an object is independent of things, once one of its aggregate object deleted, it is not necessarily just delete the object represents part of things. In combination relationship, the objects that represent the whole thing responsible for creating and deleting objects represent part of things, objects that represent part of things belongs only to a combination of objects. Once the composite object deletion will immediately delete the corresponding object represents part of things.

(3) association - is represented by the static relationship, into reflexive associated binary associations, N Element associated

Association (Association) is a common structural characteristics, behavior characteristics, relationships and semantic chain (chain shows a relationship between the objects and the relationships between the objects associated with the class represented by the class) description

(4) dependency - dependency between objects represented in behavior with message

Suppose there are two elements X, Y, if X is defined modifications may result in changes to the definition of other elements including Y, called Y elements depends on the element X. For the class, if there is relationship between two classes, so long as the general relationship can be expressed, no longer represents between these two classes there are dependencies.

  Step of establishing a class diagram:

  • Demand for problem areas, determine system
  • Determine the class, the class of clear meaning and responsibility to determine the properties and operations
  • Determining the relationship between class
  • The relationship between class and class have been adjusted and refined, and address issues such as naming conflicts, duplication of functions and other issues
  • FIG drawing the class description and the corresponding increase in

ps: the difference between abstract classes and interfaces:

  An abstract class can not produce instances of the class directly, because the method of abstract class is often just a few statements, but no specific implementation, can not hide the abstract class is instantiated. Abstract class interface is very similar, but there are different between the two places: the interface can not contain attributes, abstract classes can have attributes; all methods declared in the interface section are not achieved, and some abstract class method may have specific implementation.

 2.4.2 demand model - use case diagram (FIG use case)

  Use case is a system, subsystem, or classes and external participants (the Actor) interactions will be described sequence of actions, including an optional operation sequence and the sequence of actions will be abnormal. The participants refers to the need to use the system or interact with the system than the system of things, including people, equipment, and other external systems. A relationship between the associated main embodiment, extended (Extend), generalization, comprising (the include) relationship.

(1) Generalization: child inherits behavior and meaning Father of use cases use cases, sub-use cases can also add new behavior and the meaning or override the parent's behavior in patients with meaning and

(2) a relationship << include >>: means between the two use cases in which the behavior of a use case contains another use case, comprising a special relationship dependency. Relationship comprising, from the direction of an arrow pointing to basic use case comprises a use case, i.e. substantially comprising a use case depends on the use case.

 (3) expansion of relations << extend >>: expansion of relations is an extension of the use case there are more rules to limit, namely, the basic use case must declare the number of extension points, and expand the use cases can only add new behavior and meaning in these extension points. In the extended relationship, the direction of an arrow extended from the basic use case to use case, i.e., with extended embodiment is substantially dependent on the use case.

Note the difference containment relationships expanded relationship: containing the relation, in the implementation of basic use cases, will be performed comprising the use case; in extended relationship, a substantially when using embodiments execution may be performed, or may not perform an extended portion, in short, to meet the conditions on the implementation, does not satisfy the condition is not executed.

  Using the relationship between the participants and their use some embodiments visualized image symbols, with the embodiment of FIG then obtained: Example using FIG. It is a direct description of the demand, so there is a demand model.

  Looking step of the Example: 

  • The participants in the system to identify external and external systems to determine the metes and bounds of the system
  • Each participant to determine the desired system behavior
  • The behavior of these systems use case named
  • Use generalization, inclusion, public relations and other extensions or changes to the processing system behavior
  • Scripting each use case
  • Differentiates the main flow of events and exceptions the event stream, if desired, indicating an abnormal condition as a separate event stream processing use cases
  • Refine use case diagram, resolve conflicts between duplicate and use cases

 2.4.3 auxiliary model - packet, sequence, and FIG other activities

(1) FIG package: Package (package) is a model of the other elements organized to form units of the mechanism system of larger particle size. UML, the packet is a packet of things, it is used to organize elements in a model upon modeling package instance does not exist in the system is running, and this type is not the same, there will be at runtime class instance.

  Package design principles:

  • Reuse equivalence principle: refers to the class into the package, the package should be considered as a reusable unit
  • Closure common principles: it refers to the need to change those classes in a package
  • Reuse common principle: that is not used with the class do not put in the same package
  • Acyclic Dependencies Principle: Refers to the dependencies between packets do not form a loop

ps: Reuse the principle of hierarchy, common closure principle, the principle of common reuse these three principles in fact are mutually exclusive, it can not simultaneously be satisfied. They are made from a different perspective of the user, the principle of equivalence reuse and reuse of common principles are considered from the perspective of reuse personnel, and the principle of common closure is in terms of maintenance personnel considerations. Closures common principles hope package the bigger the better, and the principle of common but required to reuse the package as small as possible.

(2) a sequence diagram: a set of objects used to describe the mutual interaction between the cooperating with each other upon completion of a function. It chronologically executing the operations of the respective objects and the message conveyed therebetween to show up, it is possible to clearly visually represent behavioral dependencies between objects and the operation timing relationship of the message.

  The step of establishing a sequence diagram:

  • Determine the interaction of context
  • Identify objects involved in the interaction process
  • Set lifeline for each object, namely to determine which objects exist in the entire interaction process, which objects are created and destroyed during the interaction
  • From the initial interaction of the initiation message, the lifeline between the top-down order to draw each subsequent message
  • If the message needs to indicate the nesting or / and represents the time point when the message occurred, is used to control the focus (focus control is a sequence diagram showing the symbol period, it is represented as a small rectangle on the lifeline)
  • Note that if time constraints, the constraints described in the next message plus
  • If desired, you can attach preconditions and post-conditions for each message

 (3) Activity diagram: FIG effect activity is to model the behavior of the system, it is the behavior of a system can be expressed as an activity performed by a computer, or other persons who perform, by giving various actions activities to describe the system behavior and the relationship between the transfer action. FIG class definitions each class must be provided to operate it, but can not perform the process of each of the operations represented specifically. FIG sequence showed how a set of objects interact through message, and the time sequence of messages and operations related to, but not showing the implementation detail within each operation. In this regard, activity diagrams can play a very good complement. FIG workflow activity may be generally modeled system, i.e. business process modeling systems, but also on a specific operating model for the detailed description of a computer process.

  Activities (activity) represents the mission of a process, which can represent an algorithm executed during the statement. In the activity diagram distinction operation state and an active state. Is atomic operation state, can not be broken, no internal transfer, no internal activity, the operating state of the working time occupied is negligible, the purpose is to perform the operation state into the operation, and then switch to another state. To complete its work will take some time to be active is biodegradable, not atoms.

  Lane: Lane is a regional division of the activity diagram, divided for all activities under the responsibility of each activity, each lane represents one area of ​​responsibility. Lanes and classes are not one to one relationship, lane concerned is the responsibility it represents, a lane may be implemented by a class, it may also be implemented by more than one class.

  In the activity diagram, for the same trigger event, we can turn to different activities depending on the alert conditions, each of the possible transfer of a branch. If you want to represent concurrent behavior of the system or object, you can use the fork (fork) and convergence (join) the two modeling elements. A bifurcated control flow is represented by the control flow is replaced by two or more, after the bifurcation, the flow of control executed concurrently; just confluent and diverging the contrary, represents two or more flow control is a flow control instead.

(4) member, and Deployment: member and Deployment physics modeling is both object-oriented system in FIG.

  • FIG member: the modeling of the relationships between the source code file; modeling the relationship between executables of
  • FIG deployment: FIG deployment member or the like may be used to display the software running on the computing nodes in the system topology and the node and the communication path. A system model has only one deployment diagram

basic concepts:

Member: compliant member is a system and provides a set of interfaces which physically implemented, replaceable part. Deployment member comprises a member (e.g. dll files, exe file database table, etc.), the product work member (e.g., source code files, data files, etc.), actuating member (member system obtained after execution)

FIG member of members of the class diagram class distinction :

  • Class is a logical abstraction, the physical abstraction member, i.e., the junction member may be located
  • Member is an element other logic, such as classes, physical implementation collaborative
  • Classes can have attributes and operations, typically only the operating member, and these operations can only be used via the interface member

FIG deploy two basic concepts: nodes and links

Node is the presence of physical elements computing resources on behalf of the runtime, the nodes generally have some memory and often have processing capabilities, the nodes can represent a physical device, and the system software running on the device. The connection between the nodes represent communication paths between systems interact, this path is called a communication connection. FIG nodes deployed into two categories, i.e., the processor and devices

  • Processor hardware components can execute a program, such as the processor has priority mode which processes and process scheduling, process
  • No devices are hardware components of computing power, such as a modem, a terminal, etc.

Connection represents the relationship between two hardware.

2.5 Object-oriented analysis (OOA) Process

  OOA process consists of the following major activities

(1) establishing demand model - with the embodiment of FIG.

  •  Determine the system boundary
  • Participants found
  • Defined in Example

(2) establish the basic model - FIG class

  • Found objects, define their class
  • Internal features of the object defined - attributes and operations
  • External relationship defines objects - typically - special structure, integral - partial structure, and the associated message

(3) establish auxiliary model

  • Divided package, build package diagram
  • Establish the sequence diagram
  • Create an event map
  • FIG establishment member
  • Build deployment diagram
  • Other established model diagram

(4) model statute: in the model specification defines constituents and text

(5) prototyping: Optional, combined with other activities repeated

OOA each of the above process in general is a repeated process of continuous improvement, in order to establish the basic model as the center, demand model, the basic model, a model of aid, restoration and improvement.

 

Reference books

"Object-Oriented Jitongfenxi" (2nd edition) Shao Weizhong Yang Fuqing the

"UML object-oriented technology tutorial" edited by Wang Shaofeng

 

Guess you like

Origin www.cnblogs.com/wzw0625/p/11780349.html