Elements of Object-Orientation
(1) Abstraction.
Abstraction means emphasizing the essential, intrinsic properties of an entity. In systems development, abstraction refers to the meaning and behavior of an object before deciding how to implement it. Using abstraction avoids premature consideration of some details as much as possible.
Classes implement an abstraction of an object’s data (i.e., state) and behavior.
(2) Encapsulation (information hiding).
Encapsulation is the basis for ensuring that software components have excellent modularity.
Object-oriented classes are well-encapsulated modules, with class definitions explicitly separating their description (external interfaces visible to the user) from their implementation (internal implementations not visible to the user), and their internal implementations providing protection according to their specifically defined scopes.
The object is the most basic unit of encapsulation. Encapsulation prevents the effects of changes due to program interdependencies. Object-oriented encapsulation is clearer and more powerful than encapsulation in traditional languages.
(3) Sharing
Object-oriented technology facilitates sharing at different levels
Sharing in the same class. Objects in the same class have the same data structure. These objects are in a sharing relationship with each other in terms of structure, behavioral characteristics.
Sharing in the same application. In the class hierarchy of the same application, there is inheritance of data structures and behaviors across similar subclasses where there is an inheritance relationship so that the similar subclasses share common structures and behaviors. The use of inheritance for code sharing is one of the main advantages of object orientation.
Sharing across applications. Object orientation not only allows sharing of information within the same application, but also prepares the design for reusability for future goals. Sharing of information in different applications is achieved through mechanisms and structures like class libraries.
Sung to emphasize object structure over program structure
Six Structural Elements of Object-Oriented Development Methodology
The object-oriented methodology model consists of six elements: encapsulation, abstraction, modularity, hierarchy, type, concurrency, and persistence. Object-oriented approach is an object model-based programming methodology, including object-oriented analysis, object-oriented design, object-oriented programming, is currently the most widely used design methods.
Object-oriented is a software development method. Object-oriented concepts and applications have gone beyond programming and software development, expanding to areas such as database systems, interactive interfaces, application structures, application platforms, distributed systems, network management structures, CAD technology, artificial intelligence, and so on. Object-oriented is a method of understanding and abstracting the real world, and is a product of the development of computer programming technology to a certain stage.
What do you mean by object-oriented?
ObjectOriented (ObjectOriented, OO) is the current focus of interest in the computer community, which is the mainstream of software development methods in the 1990s. Object-oriented concepts and applications have gone beyond programming and software development, extending to a wide range. Such as database systems, interactive interfaces, application architecture, application platforms, distributed systems, network management structures, CAD technology, artificial intelligence and other fields.
Basic Concepts of Object-Orientation
(1) Object.
The object is anything that people want to carry out research, from the simplest integer to the complex aircraft, etc. can be regarded as an object, which can not only represent the concrete things, but also can represent the abstract rules, plans or events.
(2) The state and behavior of an object.
Objects have states, and an object describes its state in terms of data values.
Objects also have operations, which are used to change the state of the object, an object and its operations are the behavior of the object.
Objects realize the combination of data and operations, so that the data and operations are encapsulated in the unity of the object
(3) Classes.
An abstraction of objects having the same or similar properties is a class. Thus, the abstraction of an object is a class, the concretization of a class is an object, and it can also be said that instances of a class are objects.
Classes have attributes, which are abstractions of the states of objects, and data structures are used to describe the attributes of classes.
Classes have operations, which are abstractions of the behavior of an object, described by the name of the operation and the method that implements that operation.
(4) The structure of a class.
There are a number of classes in the objective world, and these classes have certain structural relationships with each other. There are usually two main structural relations, namely, general – specific structural relations, and whole – part structural relations.
1) The general-specific structure is called the categorical structure, which can also be said to be the “or” relationship, or the “isa” relationship.
②The whole-part structure is called the assembly structure, and the relationship between them is a “with” relationship, or “hasa” relationship.
(5) Messages and methods.
The structure of communication between objects is called a message. In the operation of objects, when a message is sent to an object, the message contains information that the receiving object goes to perform some operation. Sending a message should include at least a description of the name of the object that receives the message, and the name of the message (i.e., object name, method name) that is sent to that object. Generally there is also a description of the parameters, which can be variable names known to the object that recognizes the message, or global variable names known to all objects.
II. Object-Oriented Features
(1) Object Uniqueness.
Each object has its own unique identifier 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) Categorization.
Categoricality is the abstraction of objects with consistent data structures (attributes) and behavior (operations) into classes. A class is such an abstraction that it reflects important properties relevant to the application and ignores some other irrelevant content. Any class delimitation is subjective, but must be relevant to a specific application.
(3) Inheritance.
Inheritance is the mechanism by which subclasses automatically share the data structures and methods of the parent class, which is a relationship between classes. When defining and implementing a class, it is possible to build on top of a pre-existing class, taking what is defined by that pre-existing class as its own and adding several new elements.
Inheritance is the most important feature that distinguishes object-oriented programming languages from other languages, and is not found in other languages.
In the class hierarchy, a subclass that inherits the data structures and methods of only one parent class is called unary inheritance.
In the class hierarchy, a subclass that inherits data structures and methods from more than one parent class is called multiple inheritance.
In software development, class inheritance makes the software built open and expandable, which is a well-established method of organizing and classifying information, and it simplifies the workload of creating objects and classes and increases the reusability of the code.
The use of inheritance provides a canonical hierarchy of classes. Inheritance relationships through classes enable public features to be shared, increasing the reusability of software.
(4) Polymorphism (polymorphism)
Polymorphism makes it possible for the same operation or function or procedure to act on multiple types of objects and obtain different results. Different objects that receive 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 it.
Polymorphism enhances the flexibility and reusability of software.
III. Elements of Object-Orientation
(1) Abstraction.
Abstraction means emphasizing the essential, intrinsic properties of an entity. In systems development, abstraction refers to the meaning and behavior of an object before deciding how to implement it. Using abstraction avoids premature consideration of some details as much as possible.
Classes implement an abstraction of an object’s data (i.e., state) and behavior.
(2) Encapsulation (information hiding).
Encapsulation is the basis for ensuring that software components have excellent modularity.
Object-oriented classes are well-encapsulated modules, and class definitions explicitly separate their description (external interfaces visible to the user) from their implementation (internal implementations not visible to the user), with their internal implementations providing protection according to the scope of their specific definition.
The object is the most basic unit of encapsulation. Encapsulation prevents the effects of changes due to program interdependencies. Object-oriented encapsulation is clearer and more powerful than encapsulation in traditional languages.
(3) Sharing
Object-oriented technology facilitates sharing at different levels
Sharing in the same class. Objects in the same class have the same data structure. These objects are in a sharing relationship with each other in terms of structure, behavioral characteristics.
Sharing in the same application. In the class hierarchy of the same application, there is inheritance of data structures and behaviors across similar subclasses where there is an inheritance relationship so that the similar subclasses share common structures and behaviors. The use of inheritance for code sharing is one of the main advantages of object orientation.
Sharing across applications. Object orientation not only allows sharing of information within the same application, but also prepares the design for reusability for future goals. Sharing of information in different applications is achieved through mechanisms and structures like class libraries.
4. Emphasis on object structure rather than program structure
Four, object-oriented development methods
At present, the research of object-oriented development methods has become more mature, and there are many object-oriented products in the international arena. Object-oriented development methods are Coad method, Booch method and OMT method.
1. Booch method
Booch was the first to describe the object-oriented software development methodology based on the problem, pointed out that object-oriented development is a fundamentally different from the traditional functional decomposition of the design method. Object-oriented software decomposition is closer to a human understanding of objective matters, whereas functional decomposition is obtained only through a transformation of the problem space.
2. Coad method
The Coad method is an object-oriented development method proposed by Coad and Yourdon in 1989. The main advantage of the method is that through years of experience in large system development and the organic combination of object-oriented concepts, in the identification of objects, structures, attributes and operations, a set of systematic principles. The method accomplishes further class and class hierarchy identification from a requirements perspective. Although the Coad method does not introduce the terminology of classes and class hierarchies, it has in fact characterized classes and class hierarchies in the concepts of classification structures, attributes, operations, message associations, and so on.
3. The OMT approach
The OMT approach was introduced in 1991 by James Rumbaugh and five others, whose classic book is “Object-Oriented Modeling and Design”.
The approach is an emerging object-oriented development methodology, where development is based on modeling real-world objects, and then using analytical models around those objects for language-independent design. Object-oriented modeling and design facilitates the understanding of requirements, and contributes to the development of clearer, easier-to-maintain software systems. This approach provides a practical and efficient way to ensure that software development in most application areas strives for a practical approach to problem solving.
4. UML (UnifiedModelingLanguage) Language
The field of software engineering made unprecedented progress from 1995 to 1997, achieving more than the sum of the achievements of the past 15 years in the field of software engineering, and one of the most important achievements was the emergence of the Unified Modeling Language (UML). the UML would be the the dominant standard modeling language in the field of object-oriented technology.
UML not only unifies the representation of the Booch, OMT, and OOSE methods, but also further develops them, ultimately unifying them into a standard modeling language accepted by the general public.
UML is a well-defined, easy-to-express, powerful, and universally applicable modeling language. It incorporates new ideas, methods and technologies in the field of software engineering. Its scope is not limited to supporting object-oriented analysis and design, but also supports the whole process of software development starting from requirements analysis.
Software engineering on how to use object-oriented software development methodology to develop software, talk about their own experience
With the rapid development of the computer world, the enhancement of the software business, the use of software in our lives everywhere, but the software industry is also therefore the rise of the software industry, but as an IT industry insiders are not considering these issues, but how to use a good software development methodology to develop a good Software. Now, among the many software development methods, I have chosen the object-oriented approach to talk about my personal opinion. The reason why I chose it is because this approach is the most common one nowadays, and most of the developers have adopted the object-oriented approach.
When it comes to object orientation, there are a lot of articles on it. However, there are very few that explicitly give a definition of an object or state the definition of an object – at least I haven’t found one yet. Originally, “object-oriented” was used to refer to the use of encapsulation, inheritance, abstraction, and other design methods in program design. However, it is clear that this definition is no longer appropriate. Object-oriented thinking has been involved in all aspects of software development. For example, object-oriented analysis (OOA, ObjectOrientedAnalysis), object-oriented design (OOD, ObjectOrientedDesign), as well as we often say object-oriented programming implementation (OOP, ObjectOrientedProgramming). Many of the articles about object-oriented development are just about the problems to pay attention to in the object-oriented development or the better design methods used. The only way to maximize the benefits of reading these articles is to truly understand what an object is and what object orientation is. This, I’m afraid, can be a blur to beginners and even those who have been working on the subject for years on their concepts.
Object-oriented is the current focus of interest in the computer world, and it is the mainstream of software development methods in the 1990s. Object-oriented concepts and applications have been extended beyond programming and software development to a wide range. Such as database systems, interactive interfaces, application architecture, application platforms, distributed systems, network management structures, CAD technology, artificial intelligence and other fields.
No matter which method is used to develop software, the process of analysis is the process of extracting system requirements. The analyzing process consists of 3 main elements which are understanding, expressing and verifying. First, the system analyst seeks to fully understand the user’s requirements and the critical background knowledge in the neighborhood of the application through full interaction with the user and domain experts, and expresses this understanding into documentation in some non-dichotomous way. The most important documentation resulting from the analysis process is the Software Requirements Specification (which, in object-oriented analysis, consists primarily of an object model, a dynamic model, and a functional model).
Because of the complexity of the problem and the casual and informal nature of human interaction, the above understanding process usually does not achieve understanding in a single sitting. Therefore, it is necessary to further verify the correctness, completeness, and validity of the software requirements specification, and to correct problems if they are found. Obviously, the requirements analysis process is a process of repeated communication and multiple revisions between the system analyst and the users and domain experts. In other words, the processes of understanding and validation usually alternate, iteratively, and often require the use of a prototype system as an aid.
The key to object-oriented analysis (OOA) is to identify the classes and objects in the problem domain, analyze their relationships, and ultimately build a concise, accurate, and understandable model of the problem domain. Of the three types of models built from an object-oriented perspective, the object model is the most basic, important, and central.
Let’s take a look at object-oriented development methods.
I. Prime Let’s understand what is object-oriented:
(1) object: object is anything that people want to carry out research, from the simplest integer to complex aircraft, etc. can be regarded as an object, which can not only represent the concrete things, but also can represent the abstract rules, plans or events.
(2) The state and behavior of an object.
Objects have states, and an object describes its state in terms of data values.
Objects also have operations, which are used to change the state of the object, an object and its operations are the behavior of the object.
Objects realize the combination of data and operations, so that the data and operations are encapsulated in the unity of the object
(3) Classes: an abstraction of objects with the same or similar properties is a class. Thus, the abstraction of an object is a class, the concretization of a class is an object, and it can also be said that instances of a class are objects.
Classes have attributes, which are abstractions of the state of an object, and data structures are used to describe the attributes of a class.
Classes have operations, which are abstractions of the behavior of an object, described by the name of the operation and the method that implements that operation.
(4) Structure of Classes: in the objective world there are a number of classes which have certain structural relationships with each other. There are usually two main structural relationships, namely general – specific structural relationship and whole – part structural relationship.
1) The general-specific structure is called the categorical structure, which can also be said to be the “or” relationship, or the “isa” relationship.
②The whole-part structure is called the assembly structure, and the relationship between them is a “with” relationship, or “hasa” relationship.
(5)Messages and Methods:The structure for communication between objects is called a message. In object manipulation, when a message is sent to an object, the message contains information about the receiving object to perform some operation. Sending a message should include, at a minimum, a description of the name of the object that receives the message, the name of the message sent to that object (i.e., the object name, the method name). Generally there is also a description of the parameters, which can be variable names known to the object that recognizes the message, or global variable names known to all objects.
II. Let us recognize the characteristics and several elements of object orientation:
(1) Object uniqueness. (2) Categorization. (3)Inheritance. (4) Polymorphism (polymorphism)
Elements of object orientation:(1) Abstraction. (2) Encapsulation (information hiding). (3) Sharedness
III. Difference between Object-Oriented and Object-Based:
Many people do not distinguish between the two different concepts of “Object-Oriented” and “Object-Based”. The three main features of object orientation (encapsulation, inheritance, and polymorphism) are the same. Usually “object-based” is the use of objects, but can not use existing object templates to generate new object types, and then generate new objects, that is, “object-based” does not have the characteristics of inheritance. Polymorphism” is expressed as a parent type of object instances of subclasses, without the concept of inheritance there is no way to talk about “polymorphism”. Nowadays, many popular technologies are based on objects, they use some encapsulated objects, call the methods of the object, set the properties of the object. But they don’t allow programmers to derive new object types. They can only use the methods and properties of existing objects. So when you’re determining whether a new technology is object-oriented, you can usually use the last two characteristics to do so. “Both object-oriented and object-based implement the concept of encapsulation, but object-oriented implements inheritance and polymorphism, while object-based implements inheritance and polymorphism. “But object-oriented implements “inheritance and polymorphism”, whereas object-based does not, which is indeed quite a mouthful.
People involved in object-oriented programming can be divided into “library creators” and “library users” according to the division of labor. People who use libraries do not always have object-oriented thinking, usually know how to inherit and derive new objects can use libraries, however, our thinking is not really turn around, the use of libraries is only in the form of object-oriented, but essentially just an extension of the library function.
Object-orientation is a way of thinking, a way of thinking about things, and it is usually expressed in terms of whether we solve a problem as a process, or whether we abstract the problem into an object to solve it. In many cases, we will unknowingly follow the process approach to solve it, rather than considering the problem to be solved by abstracting it into an object to solve it. Some people do procedural programming under the guise of object orientation.
After a certain understanding of object-oriented methodology, we can know that the starting point and fundamental principle of object-oriented methodology is to simulate the habitual way of thinking of human beings as much as possible, so that the method and process of developing software is as close as possible to the human understanding of the world to solve the problem of the methods and processes, that is, to make the description of the problem of the problem space (also known as the problem domain) and the realization of the solution to solve the problem of the solution space (also known as the solution domain) in the structure and structure of the problem space (also known as the solution domain). That is, to make the problem space of describing the problem (also called the problem domain) and the solution space of realizing the solution (also called the solution domain) as consistent as possible in the structure.
IV. Object-oriented methodology and traditional methodology has a great advantage over:
1. It is consistent with the way people are used to thinking.
Traditional programming techniques are process-oriented design methodologies, which are computation-centered and treat data and process as separate parts of each other, with the data representing the object in the problem space and the program code used to process that data. Object-oriented methodologies, on the other hand, are object-centered, and software systems developed with such techniques consist of objects.
2. Stability.
The traditional software development methodology is centered on computational methodology, and the development process is based on functional analysis and functional decomposition, so it is very unstable. And object-oriented methodology is based on constructing the object model of the problem neighborhood and constructing the software system with the object as the center, and its basic practice is that the object simulates the entity in the problem neighborhood, and inscribes the connection between the entities with the connection between the objects. Since entities in the real world are relatively stable, software systems constructed with objects in mind are also relatively stable.
3. Good reusability.
The traditional software reuse technology is to use the standard function library, that is, trying to use the standard function library function as a “prefabricated parts” to build a new software system, but the standard function lacks the necessary “flexibility”, can not be adapted to the different needs of different applications, and from time to time, it is not possible to adapt to the different needs of different applications, and from time to time. However, standard functions lack the necessary “flexibility” to adapt to the different needs of different applications, and from time to time the ideal reusable software components. In the actual development of a new software system, most of the functions are usually written by the developers themselves, and even the vast majority of the functions are new.
Object-oriented software technology has a great deal of flexibility when it comes to constructing new software systems from available software components. It has two ways of reusing an object class: one way is to create an instance of that class and thus use it directly, and the other way is to derive from it a new class that meets current needs. The reusability it achieves is natural and accurate, unlike the traditional approach which is deliberate.
4. It is easier to develop large software products.
Inadequate methods of organizing developers are often the main cause of problems when developing large software products. With object-oriented methodology, each object that constitutes a software system is like a micro-program, has its own data, operations, functions and uses, therefore, a large software product can be broken down into a series of essentially independent of each other to the product to deal with, so it is easier to develop large-scale software.
5. Maintainability.
With the traditional method and process-oriented language developed software is difficult to maintain, but the object-oriented approach due to the existence of the following reasons, so the maintenance is good.
Factor: object-oriented software is more stable.
Object-oriented software is easier to modify.
Object-oriented software is easier to understand.
Object-oriented software is easy to test and debug.
Finally:
Currently, the research of object-oriented development methodology has become increasingly mature, and internationally there have been, a number of object-oriented products appeared. I believe that this approach in the continuous improvement of not only now applicable, even in the future, it will be used by a considerable number of developers.
An Object-Oriented Approach to Analysis
The first step is to identify objects and classes. An object, as used here, is an abstraction of data and how it is processed, which reflects the ability of a system to hold and process information about something in the real world. A class is a description of a collection of attributes and methods common to multiple objects, and it includes a description of how to create a new object within a class.
The second step is to determine the structure (structure). Structure refers to the complexity and connectivity of the problem domain. The class member structure reflects the generalization-specialization relationship, and the whole-part structure reflects the relationship between the whole and the part.
The third step is to determine the subject. The theme is the general overview of things and the overall analytical model.
The fourth step, determine the attributes (attribute). An attribute is a data element that can be used to describe an instance of an object or categorical structure that can be given in a diagram and specified in the object’s store.
Step five, determine the method (method). A method is some processing that must be done after a message is received: methods are to be defined in the diagram and specified in the object’s store. For each object and structure, those used to add, modify, delete and select a method itself are implicit (although they are to be defined in the object’s store, but not given on the diagram), while some are shown.