C - basic information (1) object oriented

White ice 2021-05-04 15:19:54
basic information object oriented

First of all, let's review what is the object .

The object here is not us c# Examples in , stay c# We can also regard a class as an object . But in object-oriented programming, this object should be an implementation object , The definition of an object is what this implementation does . From simple to complex can be seen as an object , It can not only express concrete things , Can also represent abstract rules 、 Plan or event .

It is said that everything is the object , Do you have to face all kinds of programming when programming , Isn't that complicated .

So object oriented , This object , Refers to the object . The so-called object refers to the objective entity and the subjective abstract concept .

Why object oriented programming ?

Object oriented is to solve the maintainability of the system , Extensibility , Reusability , Let's think more , Why can object-oriented solve the maintainability of the system , Extensibility , Reusability ?

We can find out from the history of object-oriented :

Computers are created to help people solve problems , But machines are machines after all , It needs people to set the next step instructions to complete the next step operation , Finally get the result we want . So no matter how complicated the program is , Computers can handle it easily . So in the past, the code is more and more incomprehensible, and the maintenance is more and more complex . So it's called structured programming .

The basic idea of structured programming is :

  1. Control the process in an orderly way , That is to say, the execution order of the program is limited to order 、 Branches and loops ;
  2. Turn common processing down to routines ( function ).

The advantage of structured programming is :

Three restrictions : It greatly reduces the degree of freedom of the program , Reduced combinations , So that the program is not too complicated . For this point , The order of structured programming 、 Branches and loops can implement all algorithms , Although it reduces the complexity and flexibility of the program , But the implementation ability of the program is not reduced .

routine ( function ): We just need to know the process ( function ) Name , You don't need to know the internal details of the process , namely “ Black box ”.

Although structure solves the complex problem of program control flow , But the program includes not only the control structure , It also includes the data to be processed . As processing data increases , The complexity of the program will also rise . Now , Object oriented programming is coming !

Object oriented programming is divided into several steps ?

Object oriented is an idea , He asked us to analyze and solve problems , Turn thinking and emphasis to the object in reality , And then through UML Tools to clarify the relationship between these objects , Finally, the object and the relation between the objects are realized by the object-oriented language . It is divided into object-oriented analysis (OOA), Object oriented design (OOD), Object oriented programming (OOP) Three big steps .

1、 First, analyze the needs , Don't think about how to program it first , First, what are the stable objects in the demand , What is the relationship between these objects .

2、 Analyze the requirements from the first step , By further extending the model , Become achievable 、 Cost compliant 、 Modular 、 A model of low coupling and high cohesion .

3、 Using an object-oriented implementation model

How to change process oriented thinking to object oriented thinking ?

When we get this requirement, we should not directly think about how to realize it . We should analyze the needs , Find the corresponding object in the demand , According to these objects found to analyze the relationship in these objects . So after we get the requirements, we first analyze the modeling to understand the relationship , Developed Maintainable , Scalable , reusable , High quality modules . The change of thinking , It may take a process

Three characteristics of object-oriented :

【 encapsulation 、 Inherit 、 polymorphic 】

The advantages of object-oriented programming ?

A、 Reusability : It's good for the speed of development If you want to develop a function, it's very difficult to implement it , At this time, there is another technology that can solve the problem very well , Its advantages are brought into play

B、 encapsulation / Abstraction : The structure is clear It's standard Normalization Easy to understand More readable

C、 Inherit : Easy to expand , It's easy to develop your own functions without changing the framework

本文为[White ice]所创,转载请带上原文链接,感谢

  1. Help, Java how to get all the current processes of the system
  2. Has anyone ever used JMeter or written tests in httpUnit????
  3. Living in a mountain village in late spring
  4. Partridge day, spring of HKUST
  5. JavaScript异步编程4——Promise错误处理
  6. 海康摄像SDK开发笔记(一):海康威视网络摄像头SDK介绍与模块功能
  7. JavaScript asynchronous programming 4 -- promise error handling
  8. Haikang video SDK development notes (1): introduction and module functions of Hikvision webcam SDK
  9. JOP:用于FPGA的嵌入式实时系统中的Java优化处理器内核
  10. Spring Boot源码:使用MongoDB MongoTemplate公开REST在几分钟内实现CRUD功能
  11. Spring Boot应用程序事件教程 - reflectoring
  12. 带有Resilience4j断路器的Spring云网关 - rome
  13. 经验分享:Apache Kafka的缺点与陷阱 - Emil Koutanov
  14. 通过Spring Boot Webflux实现Reactor Kafka
  15. 从Java 8升级到Java 11应该注意的问题
  16. Jop: Java optimized processor core for FPGA embedded real time system
  17. Spring boot source code: use mongodb mongotemplate to open rest to realize crud function in a few minutes
  18. Spring boot application event tutorial - reflecting
  19. Spring cloud gateway with resilience4j circuit breaker - ROM
  20. Experience sharing: shortcomings and pitfalls of Apache Kafka - Emil koutanov
  21. Realization of reactor Kafka through spring boot Webflux
  22. RPC框架设计----Socket与I/0模型
  23. Problems in upgrading from Java 8 to Java 11
  24. RPC framework design -- socket and I / 0 model
  25. RPC框架设计----I/0模型
  26. RPC framework design: I / 0 model
  27. RPC框架设计----NIO编程缓冲区Buffer
  28. RPC框架设计----NIO编程缓冲区Buffer
  29. RPC framework design -- NiO programming buffer
  30. RPC framework design -- NiO programming buffer
  31. Java多线程基础
  32. Java multithreading Foundation
  33. 码农飞升记-00-Java发展历程
  34. Development history of coder-00-java
  35. 码农飞升记-00-Java发展历程
  36. Development history of coder-00-java
  37. Spring and Autumn Moon
  38. Node.js与Spring Boot比较? - Ryan Gleason
  39. Spring WebFlux的明显陷阱 - ŁukaszKyć
  40. Spring创始人Rod大叔对YAML的真实想法
  41. Compare node.js with spring boot- Ryan Gleason
  42. Obvious pitfalls of spring Webflux- Ł ukaszKy ć
  43. Spring founder uncle rod's real thoughts on yaml
  44. 码农飞升记-02-OracleJDK是什么?OracleJDK的版本怎么选择?
  45. What is manong feisheng-02-oracle JDK? How to choose the version of Oracle JDK?
  46. Spring tide surging Xinanjiang
  47. Linux内核软中断
  48. Linux kernel soft interrupt
  49. Linux内核软中断
  50. Linux kernel soft interrupt
  51. Java multithreading Foundation
  52. The construction of Maven private library nexus
  53. I / O stream in Java
  54. JDK 16:Java 16的新功能 - InfoWorld
  55. 在Java中本地进行线程间数据传输的三种方式和源码展示
  56. jdon导致cpu 99%最后tomcat死掉---banq给予回复
  57. 用领域事件模拟AOP注入
  58. JDK 16: new function of Java 16 - InfoWorld
  59. Cartoon: from JVM lock to redis distributed lock
  60. Spring 3.1 终于加入了Cache支持