Object-Oriented Programming
Object-oriented programming organizes software around objects that combine state with behavior. Classes, interfaces, inheritance, and composition help you define how those objects are created and collaborate.
itSoftware engineering | OpenSkills.info
Intro
Object-Oriented Programming
Object-oriented programming organizes a program around objects. An object combines state with behavior. State records what the object knows. Behavior defines what the object can do.
A class describes a kind of object. It declares the fields that hold state, the methods that provide behavior, and often the constructors that initialize new objects. Each object created from a class is an instance. Two instances can follow the same class definition while holding different state.
This model gives you a useful design question: who should own this state and the rules that change it? A good object keeps related state and behavior together. Client code asks the object to perform an operation instead of changing its internals directly.
The four core ideas
Abstraction
Abstraction models the attributes and interactions that matter for a problem. A payment method may expose an operation to authorize a charge. Client code does not need every detail of the payment network to use that operation.
An abstraction is selective. It leaves out details that do not belong in the current model. The useful question is not whether the class resembles a real thing. Ask whether its public behavior represents a clear responsibility in the software.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://docs.oracle.com/javase/tutorial/java/concepts/index.html
Supports
- Objects as bundles of state and behavior
- Classes as blueprints for objects
- Inheritance of state and behavior
- Interfaces as contracts
- Introductory study path for object-oriented concepts
- https://docs.oracle.com/javase/tutorial/java/concepts/object.html
Supports
- Fields storing object state
- Methods exposing behavior and supporting object communication
- Data encapsulation through hidden state and method interaction
- Objects containing other objects
- Quiz answers about objects, encapsulation, and behavior-focused tests
- https://docs.oracle.com/javase/tutorial/java/concepts/class.html
Supports
- Classes as definitions from which instances are created
- Multiple instances following one class definition
- https://docs.oracle.com/javase/tutorial/java/concepts/interface.html
Supports
- Methods forming an object's interface
- Interfaces as contracts between classes and clients
- Implementing classes providing interface methods
- https://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html
Supports
- Base and derived class terminology
- Inheritance of eligible fields and methods
- Overriding inherited instance methods
- Derived objects usable through ancestor types
- Java single class inheritance
- https://docs.oracle.com/javase/specs/jls/se25/html/jls-8.html
Supports
- Classes as reference-type declarations
- Fields, methods, constructors, initializers, and nested types
- Access modifiers and inherited members
- Abstract and final classes
- Method overriding, hiding, and overloading
- https://docs.oracle.com/javase/specs/jls/se25/html/jls-9.html
Supports
- Interface declarations and members
- Interface implementation by classes
- Interfaces as common supertypes
- Multiple interface inheritance without a shared superclass
- Lack of interface instance variables
- https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/tutorials/oop
Supports
- Abstraction, encapsulation, inheritance, and polymorphism
- Derived account types sharing base behavior
- Virtual methods and overriding in an evolving example
- https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/object-oriented/
Supports
- Type definitions as object blueprints
- Encapsulation and member accessibility
- Fields, methods, constructors, properties, and other members
- Class inheritance and multiple interface implementation
- Distinctions among classes, structs, and records
- https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/object-oriented/polymorphism
Supports
- Derived objects used through base-class references
- Runtime selection of overridden virtual behavior
- Uniform client work across related concrete objects
- Quiz answers about dispatch and type branching
- https://docs.python.org/3/reference/datamodel.html
Supports
- Objects having identity, type, and value
- Attribute access and class instances
- Special methods and object-model customization
- Multiple base classes in Python
- Language-specific equality and lifecycle study
- https://docs.python.org/3/tutorial/classes.html
Supports
- Python class and instance objects
- Inheritance syntax
- Multiple inheritance and method resolution order
- https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection
Supports
- Dependencies as objects another object depends on
- Constructor injection of dependencies
- Separation of service registration from service use
- https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practices
Supports
- Tests focused on behavior rather than implementation
- Testing private behavior through public-facing methods
- Isolated test doubles for explicit collaborators
- Arrange, act, and assert test structure
- https://github.com/sindresorhus/awesome
Supports
- Discovery of the curated Software Architecture list
- https://github.com/simonaronsson/awesome-software-architecture
Supports
- Discovery of PlantUML
- Discovery of draw.io
- Discovery of Visual Paradigm
- Relevance of the selected projects as software-modeling tools
- https://plantuml.com/class-diagram
Supports
- Text-based class-diagram generation
- Classes, attributes, methods, and visibility
- Extension, implementation, composition, aggregation, and dependency notation
- PlantUML Awesome Link rationale
- https://www.drawio.com/docs/diagram-types/uml/class-diagrams/
Supports
- UML class-diagram shape libraries and templates
- Class attributes, methods, visibility, and scope notation
- Relationship connectors and multiplicity labels
- Rough and detailed modeling workflows
- draw.io Awesome Link rationale
- https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-class-diagram/
Supports
- Class names, attributes, operations, and visibility
- Association, aggregation, composition, inheritance, and multiplicity
- Availability of a free Community Edition
- Visual Paradigm Awesome Link rationale
