As a first doorProgramThe design language is C ++, and I will also talk about OOP for students who have been using the current family of science and technology.
When we were young, parents did what they could to cultivate us. For example, take a meal by yourself.
Mom would patiently tell us that she grabbed the bowl with her hands and opened the lid with another hand. Then she picked up the rice spoon and dug a proper size of rice cake into the bowl, repeat a few times, set aside the spoon and cover the lid based on your food intake. OK. It's a good meal. This is a process. Mom just teaches you how to do it. Mom didn't say that. We need a person, a bowl, a spoon, a pot that can cook rice and some rice. Now we have prepared it. Then we will cook it in a pot.
I also know that when I started to contact C ++ when I was a freshman, it was normal that most of your life was a process, however, there are exceptions. I like fishing. When I am fishing, I always consider fish hooks, fish lines, and bait.
So how to switch the process and object ideas.
1. Start to consider the different focus, the process cares about action, and the object cares about entity.
2. Process and object considerations during implementation
The following is an example of TCP socket client connection.
Process
1. Set the socket description Structure
2. Set to open socket
3. connect to a remote TCP Server
Object
For a tcpsocket object, we may need a session object to maintain a session. A session may be related to several tcpscoket, such as ftp. A session has two TCP connections and one controls one data.
Summarize with my own words
Process, how to do it, and how the process is.
What is the relationship between objects and objects?