4.3. OOP

Object Oriented Programming in GH-Python

Object-Oriented Programming is a programming paradigm that provides a certain structure program so that properties and behaviors are connected into individual objects. In order to access this properties you will learn how dot notation and classes works.

Vertices If we take a sphere as an object, we want to have atributes or properties that describe the object. The Method of an object will allow to perform a function, those are action that allow the sphere to do something. Vertices

Classes and Structures

Most probably that we will be using more than one sphere at the same time, every one with its own role. That is why every sphere needs to be created in the same way, and for that reason we need to work with Classes and Structures that is simply a “template” that will define atributes and methods an object will contain. When we create an object, we are generating an instance of a Class or structure. Vertices

Dot Notation

Dot Notation is simply the way how we access the Attributes and Methods of an object. Vertices

Functions

Functions are Methods that are not associated with any particular Class or Object. Vertices