Day 14 – Basic Classes and Objects
๐️ Day 14 – Basic Classes and Objects 1. Learning Objectives By the end of Day 14, you will be able to: Understand the difference between a class (blueprint) and an object (instance). Define your own classes with attributes (data) and methods (functions). Use the special __init__ method to initialise objects with custom data. Create multiple instances representing real AEC elements (beams, rooms, columns). Write a __str__ method to control how objects are printed. Organise related data and behaviour together – the foundation of Object‑Oriented Programming. 2. Concept Explanation 2.1 Why OOP in AEC? In the built environment, we naturally think in terms of objects: A beam has a span, load, depth, and can compute its moment and deflection. A room has length, width, height, and can compute its area and volume. A building contains a list of floors, each with its own properties. OOP lets you model these real‑world entities directly in code. Instead of scat...