Object Oriented thinking

Source: Internet
Author: User

Object-oriented thought editing
Object-oriented programming language must have a linguistic component that describes the object and its relationship to each other. These programming languages can be summed up in the following categories: All things in the system are objects, objects are the encapsulation of attributes and their operations, objects can be divided into classes by their nature, objects become instances of classes, instance relationships and inheritance relationships are static relationships between objects, and message passing is the only form of dynamic contact between objects. is also the only form of computation; The method is the sequence of messages.
Chinese name
Object Oriented thinking
Nature
thought
Category
Programming languages
Areas
Software
Directory
    1. 1 Introduction
    2. 2 Understanding
    1. 3 Object-oriented
    2. 4 Existing Problems
    1. 5 Conceptual Characteristics
    2. 6 Elements
Introduction EditThis paper constructs the software system from the objective object in the real world, and uses the natural thinking mode of human as far as possible in the system construction, emphasizes to think the problem directly with the things in the problem domain (real world), to understand the problem, and according to the essential characteristics of these things, to represent them as the objects of the system in an abstract way. , as the basic constituent unit of a system (rather than using something that is far more relevant to the real world, and having no other concept of the corresponding relationship to construct the system). This allows the system to directly map the problem domain and maintain the original appearance of things and their interrelationships in the problem domain.Understanding EditingIt can have different levels of understanding: from the perspective of the world view, the basic philosophy of object-oriented is that the world is composed of various objects with its own laws of motion and internal state, and the interaction and communication between different objects constitute the complete real world. Therefore, people should understand the world according to the reality of the real world, directly through the object and its interrelationship to reflect the world. Such a system can be built to match the real world. From the methodological point of view, the object-oriented approach is the direct application of the object-oriented world outlook in the development method. It emphasizes that the structure of the system should correspond directly to the structure of the real world, and should be structured around the real-world objects, rather than constructing the system around functions.Object-oriented editingObject Oriented,oo is the focus of current computer industry, and it is the mainstream of software development method in the 90. Object-oriented concepts and applications have gone beyond programming and software development to a wide range. Such as DatabaseSystem, interactive interface, application structure, application platform, distributed system, network management structure, CAD technology, artificial intelligence and other fields. When it comes to object-oriented, there are many articles in this area. However, it is very rare to explicitly give an object definition or description of the object-at least I haven't found it yet. At first, "object-oriented" refers to the design methods of encapsulation, inheritance, polymorphism and abstraction in programming. However, this definition is clearly no longer suitable for the situation. Object-oriented thinking has been involved in all aspects of software development. For example, object-oriented analysis (Ooa,object oriented analyses), object-oriented designs (Ood,object oriented design), and the object-oriented programming implementations we often say (Oop,object oriented Programming). Many of the object-oriented articles are simply about the issues that need to be noted in object-oriented development or the relatively good design methods used. Look at these articles only really understand what is the object, what is object-oriented, in order to maximize their benefits. This, I'm afraid for beginners even engaged in related workYears of people will also be vague about their concepts.problem Edit Present1. reusability of software reuse refers to the nature of the same thing can be reused many times without modification or slight modification. The reusability of software is Software EngineeringPursuit of one of the goals. 2. Poor maintainability Software Engineering emphasizes the maintainability of software, emphasizes the importance of documentation, and stipulates that the final software product should consist of complete and consistent configuration components. In the process of software development, it is emphasized that the readability, modification and testability of software are important quality indexes of software. It is proved that the cost and cost of the software developed by the traditional method are still very high, because the modification is poor, the maintenance is difficult, and the maintainability is poor. 3. Can not meet the needs of the user to develop large-scale software systems with traditional structured methods involved in a variety of different areas of knowledge, in the development of fuzzy requirements or dynamic changes in demand for the system, the development of software systems often can not really meet the needs of users. The software developed by the structured method is less stable, modifiable, and reusable, because the nature of the structured approach is functional decomposition, starting with a single process representing the overall function of the target system, and constantly decomposing the complex processing into sub-processing from top to bottom, so that a layer of decomposition continues, Until there are only a few easy-to-implement sub-processing functions, then use the appropriate tools to describe the processing of each of the lowest layers. Therefore, the structured method constructs the system around the "process" that implements the processing function. However, the change in user requirements is mostly functional, so this change is disastrous for process-based design. The system structure which is designed by this method is often unstable, and the change of user's demand often causes a large change of system structure, so it takes a great cost to realize this kind of change.concept feature editingThe basic concept of object-oriented (1) Object object is anything that people want to study, from the simplest integer to the complex plane can be regarded as object, it can not only express the concrete things, but also can represent abstract rules, plans or events. (2) The state and behavior of an object have a state, and an object describes its state with a data value. Objects also have actions that change the state of an object, which is the behavior of the object. The object implements the combination of data and operations, so that data and operations are encapsulated in an object's Unity (3) The abstraction of a class with objects of the same or similar nature is the class. Thus, an object's abstraction is a class, the materialization of a class is an object, or an instance of a class is an object. A class has attributes, which are abstractions of the state of an object, and data structures that describe the properties of a class. A class has an operation that is an abstraction of the behavior of an object, described by the operation name and the method that implements it. (4) The structure of the class has several classes in the objective world, and there are some structural relations between these classes. There are usually two main structural relationships, that is, general-concrete structural relationship, whole-part structure relationship. ① General--specific structure is called classification structure, can also be said to be "or" relationship, or "is a" relationship. ② whole--part of the structure is called the assembly structure, the relationship between them is a "and" relationship, or "has a" relationship. (5) The structure of communication between a message and a method object is called a message. In an object's operation, when a message is sent to an object, the message contains information that receives the object to perform some action. Send a message at least to include the name of the object that is accepting the message, the name of the message sent to the object (that is, the object name, the method name). Parameters are generally described, either as variable names known to the object that knows the message, or as global variable names that all objects know. The implementation of operations in a class is called a method, a method has a method name, a parameter, a method body. Message delivery is shown in 10-1. Ii. Object-oriented features (1) Object uniqueness Each object has its own unique identity, through which the corresponding object can be found. Throughout the life of an object, its identity does not change, and different objects cannot have the same identity. (2) Categorical classification refers to the abstraction of objects with consistent data structures (attributes) and behaviors (operations) into classes. A class is an abstraction that reflects the important nature of the application and ignores otherSome irrelevant content. The division of any class is subjective, but it must be related to the specific application. (3) Inheritance inheritance is a mechanism by which subclasses automatically share data structures and methods of the parent class, which is a relationship between classes. When defining and implementing a class, it can be done on top of an already existing class, taking the content defined by the existing class as its own content, and adding a number of new content. Inheritance is the most important feature of object-oriented programming language different from other languages, which is not available in other languages. In a class hierarchy, a subclass inherits only the data structure and methods of a parent class, which is called a single-inheritance. In the class hierarchy, subclasses inherit the data structure and methods of multiple parent classes, called multiple inheritance. In software development, the inheritance of class makes the software open and extensible, which is an effective method of information organization and classification, which simplifies the creation of objects and classes, and increases CodeTo the weight of the. With inheritance, the hierarchical structure of the class's specification is provided. Through the inheritance of the class, the common features can be shared, and the reusability of the software is improved. (4) Polymorphism (polymorphism) refers to the same operation or function, the process can be used on multiple types of objects and obtain different results. Different objects, receiving the same message can produce different results, a phenomenon known as polymorphism. Polymorphism allows each object to respond to a common message in a way that suits itself. Polymorphism enhances the flexibility and reusability of software.feature editing(1) abstract. Abstract refers to the emphasis on the nature and intrinsic properties of the entity. In system development, abstraction refers to the meaning and behavior of an object before deciding how to implement it. Use abstraction to avoid thinking about details as early as possible. The class implements the abstraction of the object's data (that is, state) and behavior. (2) Encapsulation (information hiding). Encapsulation is the basis of ensuring the good modularity of the software components. An object-oriented class is a well-encapsulated module in which the class definition explicitly separates its description (the user-visible external interface) from the implementation (an internal implementation that is not visible to the user), and its internal implementation provides protection according to the scope it specifically defines. The object is the most basic unit of encapsulation. Encapsulation prevents the change effect of program interdependencies. Object-oriented encapsulation is clearer and more powerful than traditional language encapsulation. (3) Shared object-oriented TechnologySharing shares in the same class are facilitated at different levels. objects in the same class have the same data structure. These objects are shared relationships between structures and behavior characteristics. Shared in the same app. In the class hierarchy of the same application, there exists the inheritance of data structure and behavior in each similar subclass of the inheritance relationship, so that the similar subclasses share the common structure and behavior. Using inheritance to implement code sharing is one of the main advantages of object-oriented. Shared in different apps. Object-oriented not only allows sharing of information in the same application, but also prepares conditions for reusable designs for future goals. Through the mechanism and structure of class library, information sharing in different applications is realized. 4. Emphasizing object structure rather than program structure four, object-oriented development methods the research of object-oriented development method has become more and more mature, and many object-oriented products have appeared in the world. The object-oriented development method has Coad method, Booch method and OMT method, etc. 1.Booch Method Booch First describes the basic problem of object-oriented software development method, and points out that object-oriented development is a design method which is fundamentally different from the traditional function decomposition. Object-oriented software decomposition is closer to human understanding of objective affairs, and functional decomposition is only obtained through the transformation of the problem space. The 2.Coad method Coad method is the object-oriented development method proposed by Coad and Yourdon in 1989. The main advantage of this method is that through the combination of the experience of large system development and the object-oriented concept in the past years, a set of systematic principles are put forward in the cognizance of object, structure, attribute and operation. This method completes the identification of class and class hierarchy from the point of view of requirement. Although the Coad method does not introduce terms for class and class hierarchies, it has in fact embodied the characteristics of class and class hierarchies in concepts such as classification structure, attributes, operations, and message associations. The 3.OMT method is OMT by 5 people such as James Rumbaugh in 1991, whose classic works are "object-oriented modeling and design". This approach is a new approach to object-oriented development, which is based on modeling real-world objects, and then using analytic models around these objects for language-independent design, object-oriented modeling and design facilitates understanding of requirements and facilitates the development of a clearer and easier-to-maintain software system. This method provides a practical and efficient guarantee for software development in most application fields, and strives to find a practical method for solving problems. 4.UML (Unified Modeling Language) language software engineering has made unprecedented progress in the 1995 ~1997 years, with results exceeding the total of the past 15 years in the Software engineering field, one of the most important achievements being the emergence of unified Modeling Language (UML). UML will be the dominant standard modeling language in the field of object-oriented technology. UML not only unifies the Booch method, the OMT method, the Oose method the expression method,Moreover, it has been further developed and eventually unified into the standard modeling language accepted by the public. UML is a well-defined, easy-to-express, powerful and universally applicable modeling language. It incorporates new ideas, new methods and new technologies in the field of software engineering. Its scope is not limited to support object-oriented analysis and design, but also supports the whole process of software development starting from requirement analysis. Object-oriented model the object model object model represents the static and structured system data nature, describes the static structure of the system, it is described from the object relation angle of objective world entity, and shows the relation of object. The model mainly concerns the structure, properties and operation of the objects in the system, which is the core of the three models in the analysis stage and the other two models. Frame 。 1. Objects and Class (1) objects. Object modeling is designed to describe objects. (2) class. By Abstracting objects into classes, we can abstract the problem and enhance the generalization ability of the model. (3) property. A property refers to the nature (data value) of an object in a class. (4) operation and method. An action is a function or transformation used by an object in a class. Each object in a class can share an operation, and each operation has a target object as its implied argument. method is the implementation step for the operation of the class. 2. Correlation and chain linkage are a means of establishing relationships between classes, while chains are a means of establishing relationships between objects. (1) Meaning of association and chain. Chains represent physical and conceptual junctions between objects, associations represent a relationship between classes, a chain is an instance of an association, and an association is an abstraction of a chain. (2) role. Role description The role of the class in the association, which is at the associated endpoint. (3) Restricted Association. A restricted association consists of two classes and a qualifier, which is a specific attribute used to effectively reduce the number of associated re-numbers, and the qualifier is described in the associated terminal object set. The limitation improves the accuracy of semantics and enhances the ability of querying, and in the real world, there are often qualifiers. (4) The multiplicity of associations. The multiplicity of associations refers to how many objects in a class are related to an object of the associated class. The weight is often described as "one" or "many". Figure 10-8 shows the number of different associations. Small solid circles represent "multiple", from zero to more. A small hollow circle represents 0 or one. No symbol indicates a one-to-a association. 3. Hierarchy of classes (1) Aggregation relationships. Aggregation is a "whole-part" relationship. In this relationship, there is the whole class and part of the class. The most important properties of aggregation are transitivity and inverse symmetry. Aggregation can have different levels, you can combine different classifications to get a simple aggregation tree, the aggregation tree is a simple representation, than drawing a lot of lines to connect some classes is much simpler, the object model should easily reflect the level of levels, figure 10-10 represents a multi-polar aggregation of microcomputer. (2) Generalization relationship. Generalized relationships are a highly abstract way of sharing object similarity while preserving object differences. It is a "general---specific" relationship. The generalized class is called your class, the specific class can also be called the subclass, each subclass inherits the nature of the intersection class, and some common properties and operations of each subclass are summed up in your class. As a result, generalized relationships and inheritance exist at the same time. The symbolic representation of a generalized relationship is the addition of a small triangle to the lines associated with the class, 10-114. The object Model (1) template. A template is a logical component of a class, association, and generalized structure. (2) object model. The object model is made up of one or more templates. The template divides the model into manageable sub-blocks, where the template provides an integrated intermediate unit between the entire object model and the class and the associated building blocks, and the class name and the close joint in the template are unique. Dynamic Model dynamic model is a system property related to time and change. The model describes the control structure of the system,It represents the instantaneous, the behavior of the system control nature, it is concerned about the control of the system, the execution order of operations, it represents the object from the event and state of the point of view, showing the object's interaction behavior. The system properties described by the model are organizations that trigger events, event sequences, states, events, and states. Use a state diagram as a description tool. It involves important concepts such as event, State, and operation. 1. An event event is something that occurs at a specified time. 2. State State is an abstraction of an object's property value. The property values of an object are merged into a state according to the nature of the object's significant behavior. The status indicates the object's response to the input event. 3. The state diagram is a standard computer concept, which is a graphical representation of a finite automaton, which is used as a graphical tool for building dynamic models. The state diagram reflects the relationship of the State to the event. When an event is received, the next state depends on the current state and the event that is received, and the state change caused by the event is called the transformation. A state diagram is a graph that represents a state with a node, a node that is represented by a circle, a state name in the circle, an arrow line representing the state's transformation, a flag event name, and an arrow direction that represents the direction of the transformation. • Functional Model functional model describes all calculations of the system. The functional model points out what happens, and the dynamic model determines when the object model determines what happens. The functional model shows a calculation of how the input is worth to the output value, which does not take into account the order of calculation. The functional model consists of multiple streaming diagrams. The data flow diagram is used to represent the direction from the source object to the target object, which does not contain the control information, the control information is represented in the dynamic model, and it does not represent the organization of the value in the object, the organization of the value is represented in the object model. Figure 10-15 shows an icon of a window system to display the streaming diagram. The data flow diagram contains processing, dataflow, action objects, and data storage objects. 1. Processing in the data flow graph is used to change the data values. The lowest layer processing is purely a function, a complete streaming diagram is a high-level processing. 2. The data flow in the data flow diagram relates the output of the object to its processing, processing, and object input, processing, and processing. In a computer, a data stream is used to represent an intermediate data value, and the data stream cannot change the data value. 3. The Action object action object is an active object that drives the data flow diagram by generating or using values. 4. The data storage object in the data flow diagram is a passive object that is used to store data. Unlike an action object, the data store itself does not produce any action, it responds only to storage and access requirements. Object-Oriented Analysis object-oriented analysis is aimed at modeling the system of the objective world. This section, based on the model concept described above, combines the specific example of "bank network system" to construct an accurate and rigorous analysis model of the objective world problem. The analysis model has three uses: to clarify the problem needs, to provide users and developers with clear requirements, to provide users and developers with a consultative basis, as a successorDesign and implementation of the framework. (a) The first step in an object-oriented analysis system analysis is to state the requirements. The analyst must work with the user to refine the requirements, as this represents the user's real intention, which involves analyzing the requirements and finding the missing information. The following is a "bank network system" as an example, with the object-oriented approach to development. Bank network system Problem statement: Design the software that supports the bank network, including the manual teller station and the automatic teller machine which is shared by the Branch bank. Each sub-branch uses the sub-branches of the computer to save their own accounts, processing their own affairs; the cashier station of the respective sub-branches communicates with the sub-branches computer, the Cashier station enters the account and the transaction data; automatic teller machine communicates with branch computer, branch computer and appropriation sub-branches checkout, automatic teller machine and user interface accept Cash card, Communicate with the branch computer to complete the transaction, issue cash, print receipts, system needs to record custody and security measures, the system must correctly handle concurrent access to the same account, each sub-processing for their own computers to prepare software, bank network costs according to the number of customers and cash card allocation to the branches. Figure 10-18 shows the banking network system. (ii) The establishment of the object model is first identified and associated, as they affect the overall structure and the method of solving the problem, followed by the addition of attributes, further description of the classes and associated basic networks, the use of inheritance to merge and organize classes, and the final operations to be added to the class as a byproduct of constructing dynamic models and functional models. 1. The first step in determining the class construction object model is to mark the related object classes from the problem domain, including physical entities and concepts. All classes must be meaningful in the application, and not all classes are clearly given in the problem statement. Some are implied in the problem domain or in general knowledge. The process, as shown in Figure 10-19, determines the class to find all the nouns in the problem statement, resulting in the following tentative class. Software Bank network teller automatic teller Machine Branch sub-processing computer account transaction Cashier station Transaction Data Branch computer Cash Card User cash Receipt system customer expense account data access security measures record keeping the unnecessary classes and incorrect classes are removed according to the following criteria. (1) Redundancy class: If two classes represent the same information, the class with the most descriptive ability is retained. such as "User" and "customer" is a duplicate description, because "customer" is the most descriptive, so keep it. (2) Irrelevant classes: Remove classes that are not related to the problem or are not relevant at all. For example, the apportionment cost is beyond the scope of the banking network. (3) Fuzzy classes: Classes must be deterministic, some tentative class boundaries are ambiguous or too wide, such as "record Keeping" on fuzzy classes, which is part of the "transaction". (4) Properties: Some nouns describe the properties of other objects, and are removed from the tentative class. If the independence of a certain nature is important, it should be attributed to the class rather than the attribute. (5) Operation: If the noun in the problem statement has an action meaning, the operation described is not a class. But it has its own nature andActions that need to exist independently should be described as classes. If we only construct the telephone model, "dialing" is part of the dynamic model rather than a class, but in a telephone dialing system, "dialing" is an important class, which is the date, time, location, and other attributes. In the banking network system, Fuzzy class is "system", "security measure", "record Keeping", "bank network" and so on. The attributes are: account data, receipts, cash, transactional data. The implementation of such as: "Access", "software" and so on. These should all be removed. 2. Prepare the data dictionary to prepare a data dictionary for all modeling entities. Accurately describe the exact meaning of each class, describing the scope of the classes in the current problem, including the members of the class, assumptions or limitations on usage. 3. Determine the association between two or more classes that are associated with each other. A dependency represents an association that can be implemented in a variety of ways, but the implementation considerations should be removed from the analysis model to make the design time more flexible. Associated with commonly used descriptive verbs or verb phrases, which are the representation of physical position, conduction action, communication, owner relationship, condition satisfaction, etc. Draw all possible associations from the problem statement and write them down, but do not refine them prematurely. The following are all possible associations in the banking network system, most of which are obtained by directly extracting the verb phrases from the problem. In the statement, the association of some verb phrase expression is not obvious. Finally, there are links related to the objective world or human assumptions, which must be verified with the user because the association is not found in the problem statement. Association in a bank network problem statement: • Banking network includes cashier station and automatic teller machine; • Branches to share automatic teller machines; • Sub-branches to provide sub-branches computer; • Sub-branches computer accounts payable; • Sub-branches computer processing account payment transactions; • Sub-branches have a cashier station; • The cashier station communicates with the sub-branch computer; Cashier for account entry transaction; • Automatic teller machine accepts cash card; • Automatic teller machine and user interface; • Automatic teller machine to pay cash; • Automatic teller machine print receipts; • System to handle concurrent access; • Sub-branches provide software; • Cost allocation to sub-branches. Implied verb phrases: • Branches consist of branches; • Sub-branches have accounts; • Branches have branch computers; • system provides record keeping; • system provides security; • Customer has a cash card. Correlation of knowledge Based on problem domain: • Sub-branch employment teller; • Cash card access account. Use the following criteria to remove unnecessary and incorrect associations: (1) If a class has been deleted, then the associations associated with it must also be deleted or re-expressed in other classes. In the example, we removed the "bank network" and related associations are also deleted. (2) Irrelevant association or implementation Phase Association: Removes any association outside the problem domain or involves an association in the implementation structure. such as "System processing concurrent access" is a concept of implementation. (3) Action: The association should describe the structural nature of the application domain rather than instantaneous events, so you should delete the "automatic teller machine Accept nowGold "," Automatic teller machine and user interface "and so on. (4) Derived associations: omit associations that can be defined with other associations. Because this association is redundant. The preliminary object of the banking network system is shown in Figure 10-20. It contains an association. 4. Determining attribute Properties is the property of an individual object, and the attribute is usually represented by a cosmetic noun phrase. Adjectives often denote specific enumerable attribute values, attributes cannot be fully expressed in the problem statement, they must be found by knowledge of the application domain and knowledge of the objective world. Consider only attributes that are directly related to the application, not those that go beyond the scope of the problem. First identify the important attributes, avoid those that are only used for implementation, and make meaningful names for each attribute. Remove unnecessary and incorrect attributes by the following criteria: (1) object: If the independent existence of an entity is more important than its value, then the entity is not an attribute but an object. As in the postal catalogue, "City" is a property, whereas in the census, "city" is considered an object. In the concrete application, the entity with its own nature must be the object. (2) Definite words: If the attribute value depends on a specific context, consider re-stating the attribute as a qualifier. (3) Name: The name is often used as a qualifier instead of an object's property, and when the name is not dependent on a context relationship, the name is an object property, especially when it inflexible. (4) Identifiers: When considering object ambiguity, the introduction of object identifiers, which are not listed in the object model, is implied in the object model, and only the properties that exist in the application domain are listed. (5) Internal value: If the attribute describes the internal state of an object that is not transparent to the outside, the property should be removed from the object model. (6) Refinement: Ignores attributes that are not likely to affect most operations. 5. Use inheritance to refine classes using inheritance to share public institutions, to organize classes in a second, in two ways. (1) bottom-up by generalizing the common properties of existing classes into the parent class, look for classes with similar attributes, relationships, or operations to discover inheritance. For example, "Remote Transactions" and "Cashier transactions" are similar and can be generalized as "transactions." Some generalized structures are often based on existing classifications of objective world boundaries, as far as possible, using the existing concepts. Symmetry often helps in discovering certain missing classes. (2) from top to bottom, the existing classes are refined into more specific subclasses. Materialization can often be clearly seen from the application domain. The case of each enumeration word in the application domain is the most common source of materialization. For example: menu, can have fixed menu, the top menu, pop-up menu, drop-down menu, etc., which can be specific to the menu classes to the various sub-categories of specific menus. When the same joint appears multiple times and the meaning of the same, should be as specific as possible to the relevant classes, such as "Transaction" from the "Cashier Station" and "Automatic Teller machine" entered, then "entry Station" is "cashier Station" and "Automatic cashier Station" generalization. In the class hierarchy, you can assign properties and associations to specific classes. TheAttributes and all should be assigned to the most general appropriate class, sometimes with some corrections. The enumeration cases in the application domain are the most common source of materialization. 6. Perfect object Model object modeling is not possible to ensure that the model is completely correct, the whole process of software development is a continuous improvement process. The different components of the model are mostly done at different stages, and if the defects of the model are found, they must be returned to the previous stage to be modified, and some refinement work is done only after the dynamic model and the functional model have been completed. (1) Several possible loss of objects and solutions: • There are no related attributes and operations in the same class, the class is decomposed to make the parts interrelated; • The generalized system is unclear, it is possible to separate the classes that play two roles • If there is no target class, then find and add the class that loses the target; There are redundant associations with the same name and purpose, and the associations are organized by generalizing the lost parent class. (2) Find the Extra class. Class, you can delete this class if you are missing attributes, actions, and associations. (3) Find the missing association. If the access path for the operation is lost, a new association is added to answer the query. (4) The specific situation of the network system is modified as follows: The ① cash card has several independent features. Break it down into two objects: Card permissions and Cash cards. A. Card permissions: It is a card used by the bank to identify the user's access rights, indicating the access rights of one or more user accounts; Each card permission object may have several cash cards, each with a security code, card code, which is attached to the cash card, showing the bank's card permissions. B. Cash Card: It is the data card that the automatic teller machine obtains the representation code, it is also the bank code and the cash card code data carrier. ② "Transaction" does not reflect the generality of the description of the transmission between accounts, because it involves only one account, in general, in each account, a "transaction" includes one or more "updates", an "update" is an action on the account, they are withdrawals, deposits, one of the queries. All updates in an update should be an atomic operation. Between ③ "sub-branches" and "separation processors", the distinction between "branch" and "branch processor" does not seem to affect the analysis, the computer's communication processing is actually the concept of implementation, the "sub-branch computer" into the "sub-branches", "computer" incorporated into the "branch." (iii) Establishment of a dynamic Model 1. Prepare the script for dynamic analysis start by looking for events, and then determine the sequence of possible events for each object. Algorithm execution is not considered in the analysis phase, and the algorithm is part of the implementation model. 2. Determine the event to determine all external events. Events include all information from or sent to the user, signals from external devices, inputs, transformations, and actions that can detect normal events, but cannot omit conditions and exception events. 3. Prepare the Event trace table to represent the script as an event-tracking table, which is an event-ordering table between different objects, the object is a column in the table, and each object is assigned a separate column. 4. Construct a state diagram to establish a state diagram of each object class, reflectingObjects receive and send events, and each event trace corresponds to a path in the state diagram. (iv) A functional modeling function model is used to illustrate how values are calculated, to indicate the dependencies between values and related functions, and the flow diagram helps to represent functional dependencies, where the processing should be based on the Activities and actions, where the data flow corresponds to an object or property in the object graph. 1. Determine input value, output value first list input, output value, input, output value is the parameter of the event between the system and the outside world. 2. Create a dataflow diagram that shows how the output value is worthwhile from the input, and the flow chart is usually organized hierarchically. (v) Determining the operation when establishing the object model, the classes, associations, structures, and attributes are determined, and no action is determined. The operation of the class may be finalized only after the dynamic model and the functional model have been established. Object-oriented design object-oriented design is the process of transforming the requirements from the analysis stage into an abstract system implementation plan that meets the cost and quality requirements. From object-oriented analysis to object-oriented design, it is a process to expand the model gradually. The waterfall model further divides the design into two stages: the outline design and the detailed design, similarly, the object-oriented design can be subdivided into system design and object design. The system design determines the strategy of implementing the system and the high-level structure of the target system. Object design determines the class, association, interface form and algorithm of implementing operation in the solution space. (i) Guidelines for object-oriented design 1. The modular approach to object-oriented development naturally supports the design principle of decomposing systems into modules: objects are modules. It is a module that combines the data structure and the methods of manipulating these data together. 2. Abstract object-oriented methods not only support process abstraction, but also support data abstraction. 3. Information hiding in the object-oriented approach, information hiding is achieved through the encapsulation of the object. 4. Low coupling in the object-oriented approach, the object is the most basic module, so the coupling mainly refers to the degree of correlation between different objects. Low coupling is an important criterion for design because it helps to minimize the impact of changes in one part of the system on other parts. 5. High cohesion (1) Operation cohesion. (2) in-class cohesion. (3) General--specific cohesion. (ii) Heuristic rules for object-oriented design 1. The design results should be clear and understandable to make the design results clear, easy to understand, easy to read is to improve software maintainability and reusability of important measures. Obviously, people don't reuse designs that they don't understand. To achieve: (1) consistent with the word. (2) Use of existing agreements. (3) Reduce the number of message patterns. (4) Avoid vague definitions. 2. General-The depth of the specific structure should be appropriate 3. Design simple classes should be designed to be small and simple classes, so as to develop and manage. To keep it simple, be aware of the following: (1) Avoid having too many attributes. (2) There is a clear definition. (3) To simplify the cooperation between the objects as far as possible. (4) Do not provide too much action. 4. Using a simple protocol in general, there are no more than 3 parameters in the message. 5. Using simple operations object-oriented design of the class is usually very small, generally only 3 to 5 lines of source program statements, you can use a simple sentence containing only one verb and an object to describe its function 6. Minimizing design changes generally, the higher the design quality, the longer the design result remains unchanged.The longer it is. Even if you have to modify the design, you should make the scope of the modifications as small as possible. (c) System design system design is an advanced strategy for solving problems and establishing solutions. The basic method of solving the problem must be developed, including the decomposition of subsystem, its inherent concurrency, subsystem allocation to hard software, data storage management, resource coordination, software control realization and human-computer interface. 1. System design Overview The design stage starts at the top and then refines. System design to determine the entire structure and style, this structure for the design of the later stage of a more detailed strategy design provides the basis. (1) System decomposition. The main component of a system is called a subsystem, which is neither an object nor a function but a collection of classes, associations, operations, events, and constraints. (2) determine concurrency. Many objects in the analysis model, the real world and the hardware are concurrent. (3) Processor and task assignment. Each concurrent subsystem must be assigned to a single hardware unit, either a generic processor or a specific functional unit. (4) Data storage management. The storage management of internal data and external data in the system is an important task. Usually each data store can combine data structures, files, and databases, and different data stores have a tradeoff between cost, access time, capacity, and reliability. (5) Processing of global resources. You must determine the global resources and establish a policy to access the global resources. (6) Select the software control mechanism. All interaction behaviors in the analysis model are represented as events between objects. The system design must choose some method from the various methods to realize the software control. (7) Human-computer interface design. Most of the work in the design is related to stable state behavior, but it must be considered that the user interacts with the system. 2. General framework of the system structure 3. System decomposition--build the system architecture available software libraries and Programmer's programming experience. The accurate model of the problem domain is obtained by object-oriented analysis, which lays a good foundation for the design architecture and establishes the complete framework. 4. Choose software control mechanism there are two kinds of control flow, external control flow and internal control flow in software system. 5. Data storage Management data storage Management is the basic infrastructure for the system to store or retrieve objects, which is built on a data storage management system and isolates the impact of the data storage management model. 6. Design human-computer interface in the process of object-oriented analysis, the user interface requirements have been preliminarily analyzed, in the object-oriented design process, the system should be detailed design of human-computer interface to determine the details of human-computer interaction, including the specified window and report form, design command level and other items. (d) Object design 1. Overview of Object Design 2. Three model combinations (1) Get the operation. (2) Determine the target object of the operation. 3. Algorithm design 4. Optimization Design 5. Implementation of the control 6. Adjustment Inheritance 7. Design of the association Viii. object-oriented implementation (a) programming language 1. Choosing object-oriented language to develop software using object-oriented methodThe basic purpose and main advantage is to improve the productivity of the software through reuse. Therefore, we should give preference to the object-oriented language which can express problem domain semantics most perfectly and accurately. Other factors to consider when choosing a programming language are: the user Learning The training operations that the object-oriented analysis, design and coding techniques can provide, the technical support that can be provided during the use of this object-oriented language, the development tools and development platforms that are available to developers, the need for machine performance and memory, and the ease with which existing software can be integrated. 2. Programming style (1) Improve reusability. (2) to improve the expansibility. (3) Improve robustness. (ii) The realization of class is the core problem in the development process. In a system written in object-oriented style, all data is encapsulated in an instance of the class. The entire program is encapsulated in a more advanced class. In an object-oriented system that uses existing parts, software can be implemented with only a small amount of time and effort. As long as an instance of the class is added, a small number of new classes are developed and operations are implemented to communicate with each other, the required software can be established. One solution is to develop a relatively small, relatively simple, as the basis for the development of relatively large, more complex classes. (1) "unchanged" reuse. (2) Evolutionary re-usability. A class that fully conforms to the requirements feature may not exist. (3) Development of "waste". Develop a new class without any reuse. (4) Error handling. A class should be autonomous and responsible for locating and reporting errors. (c) Implementation of application system implementation is done after all classes have been implemented. Implementing a system is a simpler and shorter process than using a procedural approach. Some instances will be used during the initialization of other classes. The rest must be explicitly explained by some main process, or as part of the representation of the class at the highest level of the system. There is a main () function in C + + and C, which can be used to illustrate instances of those classes that make up the primary object of the system. (d) Object-oriented testing (1) algorithm layer. (2) class layer. Tests the interaction between all methods and properties encapsulated in the same class. (3) Template layer. Test a set of interactions between classes that work together. (4) System layer. Each subsystem is assembled into a complete object-oriented software system, which is tested simultaneously during the assembly process. Ix. object-oriented and object-based differences many people do not differentiate between "object-oriented" and "Object-based" two different concepts. The three main characteristics of object-oriented (encapsulation, inheritance, polymorphism) are indispensable. Generally, object-based is used, but it is not possible to generate new object types from existing object templates, resulting in new objects, meaning "object-based" has no inherited characteristics. "Polymorphic" is represented as a subclass object instance of the parent class type, and without the concept of inheritance it is impossible to talk about polymorphism. Many popular techniques are object-based, using some encapsulated objects, invoking the object's methods, and setting the properties of the object. However, they do not allow programmers to derive new object types. They can only use methods and properties of existing objects. So when you decide whether a new technology is object-oriented, you can usually use the latter two features to judge. "Object-oriented" and "Object-based" are implemented.Encapsulation "concept, but the object-oriented implementation of" Inheritance and polymorphism ", and" object-based "does not implement these, is indeed very mouth. People who are engaged in object-oriented programming can be divided into "creators of class Libraries" and "users of class libraries" according to the division of labor. People who use class libraries are not all people with object-oriented thinking, often know how to inherit and derive new objects to use the class library, but our thinking does not really turn around, the use of the class library is only in the form of object-oriented, but essentially just an extension of library functions. Object-oriented is an idea, a way of thinking about things, usually whether we solve the problem in a procedural way, or abstract it into an object to solve it. In many cases, we will unconsciously follow the process to solve it, rather than consider to solve the problem of abstraction as an object to solve it. Some people are in the guise of object-oriented, doing process programming activities.

Object Oriented thinking

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.