课程: Python: Design Patterns (2021)

Understanding object-oriented programming - Python教程

课程: Python: Design Patterns (2021)

Understanding object-oriented programming

- Object oriented programming is a mainstream software development methodology today, many modern programming, languages support, object oriented programming, including Python. Design patterns require the use of object oriented programming. Therefore design parents are almost irrelevant to the non object oriented programming languages, such as C Understanding the core concepts of object oriented programming involves learning concepts, such as objects and classes, Objects represent entities in both problem and solution domains. In other words, when you're building a piece of software, you need to have components representing all the moving pieces of your solution. In addition, you need to represent all these entities, interacting with the software in the problem. Domain, take a conference registration system. And this scenario you can think of the conference participants as being in the problem domain, the registration form, the participants are using is in the solution domain. You need both represented in your software Classes Our templates used to create objects to avoid making them from scratch every time you need them. Think of classes as cookie cutters for replicating the objects classes define objects in terms of attributes and behaviors, attributes represent the properties of an entity attributes also capture the current state of the entity. On the other hand, Methods represent the behaviors of an entity. Let's go back and think about a registration system example. One more time, In such a system participants have attributes such as age, or they also have behaviors such as canceling the registration, understanding the concepts like classes and objects is critical in object oriented programming. I'd like you to revisit this topic and invest more time in learning them. If you're unclear about what they truly mean.

内容